diff --git a/src/frontends/qt4/GuiView.C b/src/frontends/qt4/GuiView.C index 2615e34462..c42f97090b 100644 --- a/src/frontends/qt4/GuiView.C +++ b/src/frontends/qt4/GuiView.C @@ -157,9 +157,7 @@ GuiView::GuiView(int id) { // Qt bug? signal lastWindowClosed does not work setAttribute(Qt::WA_QuitOnClose, false); - // FIXME: the following statement avoids memory leaks but produces a - // crash after a new window has been closed (click into the menu) - //setAttribute(Qt::WA_DeleteOnClose, true); + setAttribute(Qt::WA_DeleteOnClose, true); // hardcode here the platform specific icon size d.smallIconSize = 14; // scaling problems @@ -180,6 +178,7 @@ GuiView::GuiView(int id) GuiView::~GuiView() { + menubar_.reset(); delete &d; } diff --git a/src/frontends/qt4/QLPopupMenu.C b/src/frontends/qt4/QLPopupMenu.C index 52b94d3dd2..03c221ff50 100644 --- a/src/frontends/qt4/QLPopupMenu.C +++ b/src/frontends/qt4/QLPopupMenu.C @@ -72,6 +72,9 @@ void QLPopupMenu::update() if (name_.empty()) return; + // Here, We make sure that theLyXFunc points to the correct LyXView. + theLyXFunc().setLyXView(owner_->view()); + Menu const & fromLyxMenu = owner_->backend().getMenu(name_); owner_->backend().expand(fromLyxMenu, topLevelMenu_, owner_->view()->buffer());