[education/rkward] rkward/misc: Fix another memory leak

Thomas Friedrichsmeier null at kde.org
Sun Mar 27 21:08:27 BST 2022


Git commit 2e53abac327403f1c5a0a0deba63a016b4945c11 by Thomas Friedrichsmeier.
Committed on 27/03/2022 at 20:08.
Pushed by tfry into branch 'master'.

Fix another memory leak

M  +5    -5    rkward/misc/rkxmlguipreviewarea.cpp

https://invent.kde.org/education/rkward/commit/2e53abac327403f1c5a0a0deba63a016b4945c11

diff --git a/rkward/misc/rkxmlguipreviewarea.cpp b/rkward/misc/rkxmlguipreviewarea.cpp
index 89c138ab..b500a2ea 100644
--- a/rkward/misc/rkxmlguipreviewarea.cpp
+++ b/rkward/misc/rkxmlguipreviewarea.cpp
@@ -91,11 +91,11 @@ QWidget* RKXMLGUIPreviewArea::wrapperWidget () {
 	tb->setIcon (RKStandardIcons::getIcon (RKStandardIcons::ActionDelete));
 	connect (tb, &QAbstractButton::clicked, this, [this]() { wrapper_widget->hide(); emit previewClosed(this); });
 
-	QToolButton *menu_button = new QToolButton (this);
-	menu_button->setPopupMode (QToolButton::InstantPopup);
-	menu_button->setIcon (RKStandardIcons::getIcon (RKStandardIcons::ActionShowMenu));
-	menu_button->setMenu (menu = new QMenu ());
-	connect (menu, &QMenu::aboutToShow, this, &RKXMLGUIPreviewArea::prepareMenu);
+	QToolButton *menu_button = new QToolButton(this);
+	menu_button->setPopupMode(QToolButton::InstantPopup);
+	menu_button->setIcon(RKStandardIcons::getIcon(RKStandardIcons::ActionShowMenu));
+	menu_button->setMenu(menu = new QMenu(wrapper_widget));
+	connect(menu, &QMenu::aboutToShow, this, &RKXMLGUIPreviewArea::prepareMenu);
 
 	hl->addWidget (menu_button);
 	hl->addStretch ();


More information about the rkward-tracker mailing list