misc exit code, updated setup.nsi

git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@46 1a98c847-1fd6-4fd8-948a-caf3550aa51b
This commit is contained in:
s_nakamoto
2009-12-13 00:13:16 +00:00
parent 651d335569
commit e39bc50eb4
5 changed files with 43 additions and 15 deletions

18
ui.cpp
View File

@@ -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);
}
}