commit a0ea92357a6d47f19249472aac58710e6b8b7c4e
Author: Richard Kimberly Heck <[email protected]>
Date:   Thu Sep 17 12:31:45 2026 -0400

    Revert "Patch from Pavel addressing a memory leak"
    
    Committed unintentionally.
    
    This reverts commit 1c7934b1b35e4cdb159b2ee97871010482239ee0.
---
 src/frontends/qt/GuiToolbar.cpp | 15 ---------------
 1 file changed, 15 deletions(-)

diff --git a/src/frontends/qt/GuiToolbar.cpp b/src/frontends/qt/GuiToolbar.cpp
index e4e206dadf..459984741c 100644
--- a/src/frontends/qt/GuiToolbar.cpp
+++ b/src/frontends/qt/GuiToolbar.cpp
@@ -421,11 +421,6 @@ void DynamicMenuButton::updateTriggered()
                           && !d->func_requests_.empty()
                           && 
lyx::getStatus(d->func_requests_.front()).enabled());
        } else if (menutype == "textstyle-apply") {
-               // LEAK-TEST: QMenu::clear() does NOT delete these actions, 
because
-               // they are parented to this button, not to the menu. Without 
this
-               // they accumulate on every toolbar update (i.e. every 
keystroke).
-               for (QAction * a : m->actions())
-                       delete a;
                m->clear();
                setPopupMode(QToolButton::MenuButtonPopup);
                if (!bv) {
@@ -466,11 +461,6 @@ void DynamicMenuButton::updateTriggered()
                
setEnabled(lyx::getStatus(FuncRequest(LFUN_TEXTSTYLE_APPLY)).enabled()
                           || 
lyx::getStatus(FuncRequest(LFUN_FONT_DEFAULT)).enabled());
        } else if (menutype == "paste") {
-               // LEAK-TEST: QMenu::clear() does NOT delete these actions, 
because
-               // they are parented to this button, not to the menu. Without 
this
-               // they accumulate on every toolbar update (i.e. every 
keystroke).
-               for (QAction * a : m->actions())
-                       delete a;
                m->clear();
                setPopupMode(QToolButton::MenuButtonPopup);
                Action * default_action = new Action(FuncRequest(LFUN_PASTE),
@@ -504,11 +494,6 @@ void DynamicMenuButton::updateTriggered()
 void DynamicMenuButton::loadFlexInsets()
 {
        QMenu * m = menu();
-       // LEAK-TEST: QMenu::clear() does NOT delete these actions, because
-       // they are parented to this button, not to the menu. Without this
-       // they accumulate on every toolbar update (i.e. every keystroke).
-       for (QAction * a : m->actions())
-               delete a;
        m->clear();
        d->func_requests_.clear();
        string const & menutype = tbitem_.name;
-- 
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to