Skip to content

Commit e26e665

Browse files
committed
gui: fix crash on selecting "Mask values" in transaction view
This commits fixes a crash bug that can be caused with the following steps: - change to the "Transactions" view - right-click on an arbitrary transaction -> "Show transaction details" - close the transaction detail window again - select "Settings" -> "Mask values" The problem is that the list of opened dialogs, tracked in the member variable `m_opened_dialogs`, is only ever appended with newly opened transaction detail dialog pointers, but never removed. This leads to dangling pointers in the list, and if the "Mask values" menu item is selected, a crash is caused in the course of trying to close the opened transaction detail dialogs (see `closeOpenedDialogs()` method). Fix this by removing the pointer from the list if the corresponding widget is destroyed.
1 parent 4458ae8 commit e26e665

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/qt/transactionview.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,9 @@ void TransactionView::showDetails()
531531
TransactionDescDialog *dlg = new TransactionDescDialog(selection.at(0));
532532
dlg->setAttribute(Qt::WA_DeleteOnClose);
533533
m_opened_dialogs.append(dlg);
534+
connect(dlg, &QObject::destroyed, [this, dlg] {
535+
m_opened_dialogs.removeOne(dlg);
536+
});
534537
dlg->show();
535538
}
536539
}

0 commit comments

Comments
 (0)