diff --git a/src/desktop/view/Popup.cpp b/src/desktop/view/Popup.cpp index 8832e2b3..f6f681d5 100644 --- a/src/desktop/view/Popup.cpp +++ b/src/desktop/view/Popup.cpp @@ -405,8 +405,12 @@ void CPopup::recheckChildrenRecursive() { for (auto const& c : cpy) { if (!c || !c->visible()) continue; - c->onCommit(true); - c->recheckChildrenRecursive(); + + // keep ref, onCommit can call onDestroy + auto x = c.lock(); + + x->onCommit(true); + x->recheckChildrenRecursive(); } }