diff options
author | Philip Kaufmann <phil.kaufmann@t-online.de> | 2012-06-11 07:40:14 +0200 |
---|---|---|
committer | Luke Dashjr <luke-jr+git@utopios.org> | 2012-06-14 17:53:59 +0000 |
commit | 276cfd85304be27bb2c04c087c8f3ea25cb6f77d (patch) | |
tree | e22604dbe955365b7696b5da3473c854419edf18 /src/init.cpp | |
parent | 0b1fda6f6542a309d59f511ab1c417f891a7237b (diff) | |
download | bitcoin-276cfd85304be27bb2c04c087c8f3ea25cb6f77d.tar.xz |
Bugfix: Fix various places where Bitcoin-Qt was being shutdown improperly
(Partial/merge of upstream 9247134eaba9a1d0fa74f22de238af1476663005, 1a3f0da9229a8e524d1010cdc8bd3b9da71fe529, and 3e343522226e6c249f5cb05436eec347b87c6361)
Diffstat (limited to 'src/init.cpp')
-rw-r--r-- | src/init.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/init.cpp b/src/init.cpp index 6b6a743af9..31e05514a2 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -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; |