Changeset View
Changeset View
Standalone View
Standalone View
src/qt/bitcoin.cpp
Show First 20 Lines • Show All 196 Lines • ▼ Show 20 Lines | if (!platformStyle) { | ||||
platformStyle = PlatformStyle::instantiate("other"); | platformStyle = PlatformStyle::instantiate("other"); | ||||
} | } | ||||
assert(platformStyle); | assert(platformStyle); | ||||
} | } | ||||
BitcoinApplication::~BitcoinApplication() { | BitcoinApplication::~BitcoinApplication() { | ||||
if (coreThread) { | if (coreThread) { | ||||
qDebug() << __func__ << ": Stopping thread"; | qDebug() << __func__ << ": Stopping thread"; | ||||
Q_EMIT stopThread(); | coreThread->quit(); | ||||
coreThread->wait(); | coreThread->wait(); | ||||
qDebug() << __func__ << ": Stopped thread"; | qDebug() << __func__ << ": Stopped thread"; | ||||
} | } | ||||
delete window; | delete window; | ||||
window = nullptr; | window = nullptr; | ||||
#ifdef ENABLE_WALLET | #ifdef ENABLE_WALLET | ||||
delete paymentServer; | delete paymentServer; | ||||
▲ Show 20 Lines • Show All 73 Lines • ▼ Show 20 Lines | void BitcoinApplication::startThread() { | ||||
// crash because initialize() gets executed in another thread at some | // crash because initialize() gets executed in another thread at some | ||||
// unspecified time (after) requestedInitialize() is emitted! | // unspecified time (after) requestedInitialize() is emitted! | ||||
connect(this, &BitcoinApplication::requestedInitialize, executor, | connect(this, &BitcoinApplication::requestedInitialize, executor, | ||||
&BitcoinABC::initialize); | &BitcoinABC::initialize); | ||||
connect(this, &BitcoinApplication::requestedShutdown, executor, | connect(this, &BitcoinApplication::requestedShutdown, executor, | ||||
&BitcoinABC::shutdown); | &BitcoinABC::shutdown); | ||||
/* make sure executor object is deleted in its own thread */ | /* make sure executor object is deleted in its own thread */ | ||||
connect(this, &BitcoinApplication::stopThread, executor, | connect(coreThread, &QThread::finished, executor, &QObject::deleteLater); | ||||
&QObject::deleteLater); | |||||
connect(this, &BitcoinApplication::stopThread, coreThread, &QThread::quit); | |||||
coreThread->start(); | coreThread->start(); | ||||
} | } | ||||
void BitcoinApplication::parameterSetup() { | void BitcoinApplication::parameterSetup() { | ||||
// Default printtoconsole to false for the GUI. GUI programs should not | // Default printtoconsole to false for the GUI. GUI programs should not | ||||
// print to the console unnecessarily. | // print to the console unnecessarily. | ||||
gArgs.SoftSetBoolArg("-printtoconsole", false); | gArgs.SoftSetBoolArg("-printtoconsole", false); | ||||
▲ Show 20 Lines • Show All 454 Lines • Show Last 20 Lines |