diff options
author | s_nakamoto <s_nakamoto@1a98c847-1fd6-4fd8-948a-caf3550aa51b> | 2009-12-13 00:13:16 +0000 |
---|---|---|
committer | s_nakamoto <s_nakamoto@1a98c847-1fd6-4fd8-948a-caf3550aa51b> | 2009-12-13 00:13:16 +0000 |
commit | e39bc50eb4dd4f0a34ee4c264af83043f13543dd (patch) | |
tree | a1a40f23d06f9150c96db876f0e43879037841ae /ui.cpp | |
parent | 651d33556982d038d39f04373b9f63913bf03187 (diff) |
misc exit code, updated setup.nsi
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@46 1a98c847-1fd6-4fd8-948a-caf3550aa51b
Diffstat (limited to 'ui.cpp')
-rw-r--r-- | ui.cpp | 18 |
1 files changed, 16 insertions, 2 deletions
@@ -394,6 +394,14 @@ CMainFrame::~CMainFrame() ptaskbaricon = NULL;
}
+void ExitTimeout(void* parg)
+{
+#ifdef __WXMSW__
+ Sleep(5000);
+ ExitProcess(0);
+#endif
+}
+
void Shutdown(void* parg)
{
static CCriticalSection cs_Shutdown;
@@ -404,6 +412,7 @@ void Shutdown(void* parg) fFirstThread = !fTaken;
fTaken = true;
}
+ static bool fExit;
if (fFirstThread)
{
fShutdown = true;
@@ -411,13 +420,18 @@ void Shutdown(void* parg) DBFlush(false);
StopNode();
DBFlush(true);
+ CreateThread(ExitTimeout, NULL);
+ Sleep(10);
printf("Bitcoin exiting\n\n");
+ fExit = true;
exit(0);
}
else
{
- loop
- Sleep(100000);
+ while (!fExit)
+ Sleep(500);
+ Sleep(100);
+ ExitThread(0);
}
}
|