mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-11 21:22:47 +01:00
gui: guard accessing a nullptr 'clientModel'
During shutdown, already queue events dispatched from the backend such 'numConnectionsChanged' and 'networkActiveChanged' could try to access the clientModel object, which might not exist because we manually delete it inside 'BitcoinApplication::requestShutdown()'.
This commit is contained in:
@@ -70,7 +70,7 @@ ClientModel::ClientModel(interfaces::Node& node, OptionsModel *_optionsModel, QO
|
||||
subscribeToCoreSignals();
|
||||
}
|
||||
|
||||
ClientModel::~ClientModel()
|
||||
void ClientModel::stop()
|
||||
{
|
||||
unsubscribeFromCoreSignals();
|
||||
|
||||
@@ -78,6 +78,11 @@ ClientModel::~ClientModel()
|
||||
m_thread->wait();
|
||||
}
|
||||
|
||||
ClientModel::~ClientModel()
|
||||
{
|
||||
stop();
|
||||
}
|
||||
|
||||
int ClientModel::getNumConnections(unsigned int flags) const
|
||||
{
|
||||
ConnectionDirection connections = ConnectionDirection::None;
|
||||
|
||||
Reference in New Issue
Block a user