Bugfix: Fix various places where Bitcoin-Qt was being shutdown improperly

(Partial/merge of upstream 9247134eab, 1a3f0da922, and 3e34352222)
This commit is contained in:
Philip Kaufmann
2012-06-11 07:40:14 +02:00
committed by Luke Dashjr
parent 0b1fda6f65
commit 276cfd8530
9 changed files with 26 additions and 15 deletions

View File

@@ -41,6 +41,17 @@ void ExitTimeout(void* parg)
#endif
}
void StartShutdown()
{
#ifdef QT_GUI
// ensure we leave the Qt main loop for a clean GUI exit (Shutdown() is called in bitcoin.cpp afterwards)
QueueShutdown();
#else
// Without UI, Shutdown() can simply be started in a new thread
CreateThread(Shutdown, NULL);
#endif
}
void Shutdown(void* parg)
{
static CCriticalSection cs_Shutdown;