Qt: Prevent dangling object for profile dialog
When running the profiles dialog from the main status bar, some objects appear to be not cleaned up properly with Qt 6. This will circumvent this, by creating an object for the dialog and cleaning it on closing. Fixes #18525
This commit is contained in:
parent
a42d245c2b
commit
c59804f25f
|
@ -630,10 +630,11 @@ void MainStatusBar::manageProfile()
|
|||
QAction *pa = qobject_cast<QAction*>(sender());
|
||||
|
||||
if (pa) {
|
||||
ProfileDialog cp_dialog;
|
||||
ProfileDialog * cp_dialog = new ProfileDialog(this);
|
||||
cp_dialog->setAttribute(Qt::WA_DeleteOnClose);
|
||||
|
||||
int profileAction = pa->property("dialog_action_").toInt();
|
||||
cp_dialog.execAction(static_cast<ProfileDialog::ProfileAction>(profileAction));
|
||||
cp_dialog->execAction(static_cast<ProfileDialog::ProfileAction>(profileAction));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue