fix update window causing crash, misc tweaks

This commit is contained in:
dborth 2009-05-30 18:26:02 +00:00
parent ae402f0ca1
commit 2064ef82af
3 changed files with 31 additions and 22 deletions

View File

@ -84,7 +84,7 @@ HaltDeviceThread()
* This checks our devices for changes (SD/USB removed) and * This checks our devices for changes (SD/USB removed) and
* initializes the network in the background * initializes the network in the background
***************************************************************************/ ***************************************************************************/
static int devsleep = 3*1000*1000; static int devsleep = 1*1000*1000;
static void * static void *
devicecallback (void *arg) devicecallback (void *arg)

View File

@ -99,6 +99,11 @@ ResumeGui()
static void static void
HaltGui() HaltGui()
{ {
#ifdef HW_RVL
if(updatethread != LWP_THREAD_NULL)
LWP_JoinThread(updatethread, NULL);
#endif
guiHalt = true; guiHalt = true;
// wait for thread to finish // wait for thread to finish
@ -224,7 +229,6 @@ WindowPrompt(const char *title, const char *msg, const char *btn1Label, const ch
static void * static void *
EmulatorUpdate (void *arg) EmulatorUpdate (void *arg)
{ {
sleep(3);
bool installUpdate = WindowPrompt( bool installUpdate = WindowPrompt(
"Update Available", "Update Available",
"An update is available!", "An update is available!",

View File

@ -185,9 +185,8 @@ void InitializeNetwork(bool silent)
while(inNetworkInit) // a network init is already in progress! while(inNetworkInit) // a network init is already in progress!
usleep(50); usleep(50);
if(networkInit) // check again if the network was inited if(!networkInit) // check again if the network was inited
return; {
inNetworkInit = true; inNetworkInit = true;
char ip[16]; char ip[16];
@ -211,6 +210,9 @@ void InitializeNetwork(bool silent)
} }
inNetworkInit = false; inNetworkInit = false;
} }
if(!silent)
CancelAction();
}
void CloseShare() void CloseShare()
{ {
@ -279,6 +281,9 @@ ConnectShare (bool silent)
{ {
networkShareInit = true; networkShareInit = true;
} }
if(!silent)
CancelAction();
} }
if(!networkShareInit && !silent) if(!networkShareInit && !silent)