|
|
@ -9,7 +9,6 @@ |
|
|
|
#include "init.h" |
|
|
|
#include "init.h" |
|
|
|
#include "util.h" |
|
|
|
#include "util.h" |
|
|
|
#include "ui_interface.h" |
|
|
|
#include "ui_interface.h" |
|
|
|
#include <boost/bind.hpp> |
|
|
|
|
|
|
|
#include <boost/filesystem.hpp> |
|
|
|
#include <boost/filesystem.hpp> |
|
|
|
#include <boost/filesystem/fstream.hpp> |
|
|
|
#include <boost/filesystem/fstream.hpp> |
|
|
|
#include <boost/filesystem/convenience.hpp> |
|
|
|
#include <boost/filesystem/convenience.hpp> |
|
|
@ -41,8 +40,13 @@ void ExitTimeout(void* parg) |
|
|
|
|
|
|
|
|
|
|
|
void StartShutdown() |
|
|
|
void StartShutdown() |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
#ifdef QT_GUI |
|
|
|
// ensure we leave the Qt main loop for a clean GUI exit (Shutdown() is called in bitcoin.cpp afterwards)
|
|
|
|
// ensure we leave the Qt main loop for a clean GUI exit (Shutdown() is called in bitcoin.cpp afterwards)
|
|
|
|
uiInterface.QueueShutdown(); |
|
|
|
uiInterface.QueueShutdown(); |
|
|
|
|
|
|
|
#else |
|
|
|
|
|
|
|
// Without UI, Shutdown() can simply be started in a new thread
|
|
|
|
|
|
|
|
CreateThread(Shutdown, NULL); |
|
|
|
|
|
|
|
#endif |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void Shutdown(void* parg) |
|
|
|
void Shutdown(void* parg) |
|
|
@ -150,11 +154,6 @@ bool AppInit(int argc, char* argv[]) |
|
|
|
exit(ret); |
|
|
|
exit(ret); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Create the shutdown thread when receiving a shutdown signal
|
|
|
|
|
|
|
|
boost::signals2::scoped_connection do_stop( |
|
|
|
|
|
|
|
uiInterface.QueueShutdown.connect(boost::bind( |
|
|
|
|
|
|
|
&CreateThread, &Shutdown, static_cast<void*>(0), false))); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fRet = AppInit2(); |
|
|
|
fRet = AppInit2(); |
|
|
|
} |
|
|
|
} |
|
|
|
catch (std::exception& e) { |
|
|
|
catch (std::exception& e) { |
|
|
|