From 0b1fda6f6542a309d59f511ab1c417f891a7237b Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Mon, 11 Jun 2012 07:40:14 +0200 Subject: Don't call exit() in Shutdown() for Bitcoin-Qt (fixes a tray-icon issue) (partial of 9247134eaba9a1d0fa74f22de238af1476663005) --- src/init.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/init.cpp') diff --git a/src/init.cpp b/src/init.cpp index 5f1e4f5307..6b6a743af9 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 { -- cgit v1.2.3 From 276cfd85304be27bb2c04c087c8f3ea25cb6f77d Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Mon, 11 Jun 2012 07:40:14 +0200 Subject: Bugfix: Fix various places where Bitcoin-Qt was being shutdown improperly (Partial/merge of upstream 9247134eaba9a1d0fa74f22de238af1476663005, 1a3f0da9229a8e524d1010cdc8bd3b9da71fe529, and 3e343522226e6c249f5cb05436eec347b87c6361) --- src/init.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/init.cpp') 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; -- cgit v1.2.3