mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-21 14:34:49 +01:00
Merge bitcoin-core/gui#774: Fix crash on selecting "Mask values" in transaction view
e26e665f9f
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 https://github.com/bitcoin-core/gui/pull/708, commit4492de1be1
), 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: ACKe26e665f9f
pablomartin4btc: tACKe26e665f9f
furszy: utACKe26e665f9
hebasto: ACKe26e665f9f
, tested on Ubuntu 22.04. Tree-SHA512: 37885c22abae0ab065b4878bae46fd362f41b09609d081fd59e26bb05474f427b98771ee73f5480526afaef04e016c5ba62c956e0e85a57b6a0f44a905b68a83
This commit is contained in:
commit
04bfe8c9c3
1 changed files with 3 additions and 0 deletions
|
@ -531,6 +531,9 @@ void TransactionView::showDetails()
|
|||
TransactionDescDialog *dlg = new TransactionDescDialog(selection.at(0));
|
||||
dlg->setAttribute(Qt::WA_DeleteOnClose);
|
||||
m_opened_dialogs.append(dlg);
|
||||
connect(dlg, &QObject::destroyed, [this, dlg] {
|
||||
m_opened_dialogs.removeOne(dlg);
|
||||
});
|
||||
dlg->show();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue