diff --git a/src/init.cpp b/src/init.cpp index 5f1e4f53..6b6a743a 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -66,7 +66,10 @@ void Shutdown(void* parg) Sleep(50); printf("Bitcoin exiting\n\n"); fExit = true; +#ifndef QT_GUI + // ensure non UI client get's exited here, but let Bitcoin-Qt reach return 0; in bitcoin.cpp exit(0); +#endif } else { diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp index 3157eade..8dde8f3b 100644 --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -208,6 +208,7 @@ int main(int argc, char *argv[]) window.hide(); guiref = 0; } + // Shutdown the core and it's threads, but don't exit Bitcoin-Qt here Shutdown(NULL); } else