]> 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 52b94d3dd26c1a5ad514a4fbc8e9956d41bbbe80..03c221ff507bbf2ee405d1d975087584c3a33996 100644 (file)
@@ -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());