Skip to content

Commit 04bfe8c

Browse files
committed
Merge bitcoin-core#774: Fix crash on selecting "Mask values" in transaction view
e26e665 gui: fix crash on selecting "Mask values" in transaction view (Sebastian Falbesoner) Pull request description: This PR 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 menu item "Settings" -> "Mask values" The problem is that the list of opened dialogs, tracked in the member variable `m_opened_dialogs` (introduced in bitcoin-core#708, commit 4492de1), 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 a pointer of the list if the corresponding widget is destroyed. ACKs for top commit: achow101: ACK e26e665 pablomartin4btc: tACK e26e665 furszy: utACK e26e665 hebasto: ACK e26e665, tested on Ubuntu 22.04. Tree-SHA512: 37885c22abae0ab065b4878bae46fd362f41b09609d081fd59e26bb05474f427b98771ee73f5480526afaef04e016c5ba62c956e0e85a57b6a0f44a905b68a83
2 parents 3c0b66c + e26e665 commit 04bfe8c

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)