diff --git a/source/ngc/fileop.cpp b/source/ngc/fileop.cpp index 8798d1a..8527839 100644 --- a/source/ngc/fileop.cpp +++ b/source/ngc/fileop.cpp @@ -84,7 +84,7 @@ HaltDeviceThread() * This checks our devices for changes (SD/USB removed) and * initializes the network in the background ***************************************************************************/ -static int devsleep = 3*1000*1000; +static int devsleep = 1*1000*1000; static void * devicecallback (void *arg) diff --git a/source/ngc/menu.cpp b/source/ngc/menu.cpp index 3692bdc..ec5d7fb 100644 --- a/source/ngc/menu.cpp +++ b/source/ngc/menu.cpp @@ -99,6 +99,11 @@ ResumeGui() static void HaltGui() { + #ifdef HW_RVL + if(updatethread != LWP_THREAD_NULL) + LWP_JoinThread(updatethread, NULL); + #endif + guiHalt = true; // wait for thread to finish @@ -224,7 +229,6 @@ WindowPrompt(const char *title, const char *msg, const char *btn1Label, const ch static void * EmulatorUpdate (void *arg) { - sleep(3); bool installUpdate = WindowPrompt( "Update Available", "An update is available!", diff --git a/source/ngc/networkop.cpp b/source/ngc/networkop.cpp index 00d4b3e..00984ab 100644 --- a/source/ngc/networkop.cpp +++ b/source/ngc/networkop.cpp @@ -185,31 +185,33 @@ void InitializeNetwork(bool silent) while(inNetworkInit) // a network init is already in progress! usleep(50); - if(networkInit) // check again if the network was inited - return; - - inNetworkInit = true; - - char ip[16]; - s32 initResult = if_config(ip, NULL, NULL, true); - - if(initResult == 0) + if(!networkInit) // check again if the network was inited { - networkInit = true; - } - else - { - // do not automatically attempt a reconnection - autoNetworkInit = false; + inNetworkInit = true; - if(!silent) + char ip[16]; + s32 initResult = if_config(ip, NULL, NULL, true); + + if(initResult == 0) { - char msg[150]; - sprintf(msg, "Unable to initialize network (Error #: %i)", initResult); - ErrorPrompt(msg); + networkInit = true; } + else + { + // do not automatically attempt a reconnection + autoNetworkInit = false; + + if(!silent) + { + char msg[150]; + sprintf(msg, "Unable to initialize network (Error #: %i)", initResult); + ErrorPrompt(msg); + } + } + inNetworkInit = false; } - inNetworkInit = false; + if(!silent) + CancelAction(); } void CloseShare() @@ -279,6 +281,9 @@ ConnectShare (bool silent) { networkShareInit = true; } + + if(!silent) + CancelAction(); } if(!networkShareInit && !silent)