mirror of
https://github.com/dborth/vbagx.git
synced 2024-12-28 19:51:50 +01:00
fix update window causing crash, misc tweaks
This commit is contained in:
parent
83a1f38626
commit
c04fcf573f
@ -85,7 +85,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)
|
||||||
|
@ -102,6 +102,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
|
||||||
@ -227,7 +232,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!",
|
||||||
|
@ -183,31 +183,33 @@ 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;
|
|
||||||
|
|
||||||
char ip[16];
|
|
||||||
s32 initResult = if_config(ip, NULL, NULL, true);
|
|
||||||
|
|
||||||
if(initResult == 0)
|
|
||||||
{
|
{
|
||||||
networkInit = true;
|
inNetworkInit = true;
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// do not automatically attempt a reconnection
|
|
||||||
autoNetworkInit = false;
|
|
||||||
|
|
||||||
if(!silent)
|
char ip[16];
|
||||||
|
s32 initResult = if_config(ip, NULL, NULL, true);
|
||||||
|
|
||||||
|
if(initResult == 0)
|
||||||
{
|
{
|
||||||
char msg[150];
|
networkInit = true;
|
||||||
sprintf(msg, "Unable to initialize network (Error #: %i)", initResult);
|
|
||||||
ErrorPrompt(msg);
|
|
||||||
}
|
}
|
||||||
|
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()
|
void CloseShare()
|
||||||
@ -277,6 +279,9 @@ ConnectShare (bool silent)
|
|||||||
{
|
{
|
||||||
networkShareInit = true;
|
networkShareInit = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!silent)
|
||||||
|
CancelAction();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!networkShareInit && !silent)
|
if(!networkShareInit && !silent)
|
||||||
|
Loading…
Reference in New Issue
Block a user