diff options
author | Roland Knall <rknall@gmail.com> | 2022-10-31 10:06:45 +0000 |
---|---|---|
committer | Roland Knall <rknall@gmail.com> | 2022-10-31 10:10:42 +0000 |
commit | c59804f25f4e2b146e9685b44e01715d6c220dca (patch) | |
tree | f8ed92130116f4e1eca23775f19b36070d8aa73f /ui/qt | |
parent | a42d245c2b12aeaf9a652a430d2677456772800b (diff) |
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
Diffstat (limited to 'ui/qt')
-rw-r--r-- | ui/qt/main_status_bar.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ui/qt/main_status_bar.cpp b/ui/qt/main_status_bar.cpp index c8daddd26f..8d74ddb885 100644 --- a/ui/qt/main_status_bar.cpp +++ b/ui/qt/main_status_bar.cpp @@ -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)); } } |