]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/QLPopupMenu.C
Fix memory leaks with multiple windows and crash when deleteOnClose is set.
[lyx.git] / src / frontends / qt4 / QLPopupMenu.C
index 763664ff29f1376955ecf18a493b54e5efb7df96..03c221ff507bbf2ee405d1d975087584c3a33996 100644 (file)
@@ -30,7 +30,6 @@
 #ifdef Q_WS_MACX
 #include "kbmap.h"
 #include "QLyXKeySym.h"
-extern boost::scoped_ptr<kb_keymap> toplevel_keymap;
 #endif
 
 using std::make_pair;
@@ -73,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());