aboutsummaryrefslogtreecommitdiff
path: root/ui.cpp
diff options
context:
space:
mode:
authors_nakamoto <s_nakamoto@1a98c847-1fd6-4fd8-948a-caf3550aa51b>2009-12-13 00:13:16 +0000
committers_nakamoto <s_nakamoto@1a98c847-1fd6-4fd8-948a-caf3550aa51b>2009-12-13 00:13:16 +0000
commite39bc50eb4dd4f0a34ee4c264af83043f13543dd (patch)
treea1a40f23d06f9150c96db876f0e43879037841ae /ui.cpp
parent651d33556982d038d39f04373b9f63913bf03187 (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.cpp18
1 files changed, 16 insertions, 2 deletions
diff --git a/ui.cpp b/ui.cpp
index 262f2a8837..7432302854 100644
--- a/ui.cpp
+++ b/ui.cpp
@@ -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);
}
}