提交 84429e58 编写于 作者: J jp9000

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.
上级 8932bd39
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册