From 84429e58df0086aa6998cce059b3769292c54216 Mon Sep 17 00:00:00 2001 From: jp9000 Date: Sat, 7 May 2016 00:08:11 -0700 Subject: [PATCH] UI: Fix bug where transition refs would not release When clicking the transition properties button and creating the context menu with properties/rename, it would create actions that also included a source reference, but the parent of those actions was the main window instead of the menu, so those actions would stay created until the main window was destroyed. This would cause bugs with saving/loading scenes where children of that transition would also be perpetually referenced. So instead of using the main window, just use a pointer to the menu itself as the parent so that when the menu is destroyed, the actions are also destroyed, and the source refs released. --- obs/window-basic-main-transitions.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/obs/window-basic-main-transitions.cpp b/obs/window-basic-main-transitions.cpp index eb07b5540..212b3162e 100644 --- a/obs/window-basic-main-transitions.cpp +++ b/obs/window-basic-main-transitions.cpp @@ -484,12 +484,12 @@ void OBSBasic::on_transitionProps_clicked() QMenu menu(this); - QAction *action = new QAction(QTStr("Rename"), this); + QAction *action = new QAction(QTStr("Rename"), &menu); connect(action, SIGNAL(triggered()), this, SLOT(RenameTransition())); action->setProperty("transition", QVariant::fromValue(source)); menu.addAction(action); - action = new QAction(QTStr("Properties"), this); + action = new QAction(QTStr("Properties"), &menu); connect(action, &QAction::triggered, properties); menu.addAction(action); -- GitLab