Page MenuHomePhabricator

gui: Fix shutdown order
ClosedPublic

Authored by deadalnix on Jun 3 2020, 18:17.

Details

Reviewers
jasonbcox
Group Reviewers
Restricted Project
Commits
rABCdfaae2679de1: gui: Fix shutdown order
Summary
  • gui: Fix WalletController deletion

The wallet controller instanced must be deleted after the window instance
since it is used there.

  • gui: Expose BitcoinGUI::unsubscribeFromCoreSignals

Move only change that makes unsubscribeFromCoreSignals public. It must be
called if the event loop is not running otherwise core signals handlers
can deadlock.

  • gui: Fix m_node.startShutdown() order

This change forwards the shutdown request on the GUI (close the
application for instace) to the node as soon as possible. This way the
GUI doesn't have to wait for long operations to complete (rescan the
wallet for instance), instead those operations detect the shutdown
request and abort/interrupt.

  • Check m_internals in UnregisterValidationInterface

When a wallet is created it is registered in the validation interface (in
CWallet::CreateWalletFromFile) but it is not immediately added to the
wallets list. If a shutdown is requested before AddWallet (case more
evident when -rescan is set) then m_internals can be released (in
Shutdown -> UnregisterBackgroundSignalScheduler) before the wallet and
then ReleaseWallet would call UnregisterValidationInterface with
m_internals already released.

This is a backport of Core PR15280

Test Plan
ninja all check-all

Run bitcoin-qt on win64 and verify it shuts down properly.

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

[Bot Message]
One or more PR numbers were detected in the summary.
Links to those PRs have been inserted into the summary for reference.

This revision is now accepted and ready to land.Jun 3 2020, 20:35
This revision was automatically updated to reflect the committed changes.