mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-04-29 06:49:38 -04:00
Merge bitcoin-core/gui#864: Crash fix, disconnect numBlocksChanged() signal during shutdown
Some checks are pending
CI / test each commit (push) Waiting to run
CI / macOS 14 native, arm64, no depends, sqlite only, gui (push) Waiting to run
CI / macOS 14 native, arm64, fuzz (push) Waiting to run
CI / Windows native, VS 2022 (push) Waiting to run
CI / Windows native, fuzz, VS 2022 (push) Waiting to run
CI / Linux->Windows cross, no tests (push) Waiting to run
CI / Windows, test cross-built (push) Blocked by required conditions
CI / ASan + LSan + UBSan + integer, no depends, USDT (push) Waiting to run
Some checks are pending
CI / test each commit (push) Waiting to run
CI / macOS 14 native, arm64, no depends, sqlite only, gui (push) Waiting to run
CI / macOS 14 native, arm64, fuzz (push) Waiting to run
CI / Windows native, VS 2022 (push) Waiting to run
CI / Windows native, fuzz, VS 2022 (push) Waiting to run
CI / Linux->Windows cross, no tests (push) Waiting to run
CI / Windows, test cross-built (push) Blocked by required conditions
CI / ASan + LSan + UBSan + integer, no depends, USDT (push) Waiting to run
71656bdfaa
gui: crash fix, disconnect numBlocksChanged() signal during shutdown (furszy) Pull request description: Aiming to fix bitcoin-core/gui#862. The crash stems from the order of the shutdown procedure: We first unset the client model, then destroy the wallet controller—but we leave the internal wallet models (`m_wallets`) untouched for a brief period. As a result, there’s a point in time where views still have connected signals and access to wallet models that are not connected to any wallet controller. Now.. since the `clientModel` is only replaced with nullptr locally and not destroyed yet, signals like `numBlocksChanged` can still emit. Thus, when wallet views receive them, they see a non-null wallet model ptr, and proceed to call backend functions from a model that is being torn down. As the shutdown procedure begins by unsetting `clientModel` from all views. It’s safe to ignore events when `clientModel` is nullptr. ACKs for top commit: maflcko: lgtm ACK71656bdfaa
pablomartin4btc: re-ACK71656bdfaa
hebasto: ACK71656bdfaa
, I have reviewed the code and it looks OK. Tree-SHA512: e6a369c40aad8a5a3da64e92daa10250006f60c53feef353a5580e1bdb17fe8e1ad102abf5419ddeff1caa703b69ab634265ef3b9cfef87e9304f97bfdd2c4aa
This commit is contained in:
commit
d2ac748e9e
1 changed files with 4 additions and 0 deletions
|
@ -855,6 +855,10 @@ void SendCoinsDialog::updateCoinControlState()
|
||||||
}
|
}
|
||||||
|
|
||||||
void SendCoinsDialog::updateNumberOfBlocks(int count, const QDateTime& blockDate, double nVerificationProgress, SyncType synctype, SynchronizationState sync_state) {
|
void SendCoinsDialog::updateNumberOfBlocks(int count, const QDateTime& blockDate, double nVerificationProgress, SyncType synctype, SynchronizationState sync_state) {
|
||||||
|
// During shutdown, clientModel will be nullptr. Attempting to update views at this point may cause a crash
|
||||||
|
// due to accessing backend models that might no longer exist.
|
||||||
|
if (!clientModel) return;
|
||||||
|
// Process event
|
||||||
if (sync_state == SynchronizationState::POST_INIT) {
|
if (sync_state == SynchronizationState::POST_INIT) {
|
||||||
updateSmartFeeLabel();
|
updateSmartFeeLabel();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue