Merge pull request #52 from Bigpet/master

Dev9 plugin - prevent null dereference if no device is set
This commit is contained in:
ramapcsx2 2014-05-25 16:49:49 +02:00
commit 71ebb2493e
2 changed files with 14 additions and 6 deletions

View File

@ -171,8 +171,13 @@ s32 _DEV9open()
//ResumeThread (handleDEV9Thread); //ResumeThread (handleDEV9Thread);
NetAdapter* na=GetNetAdapter(); NetAdapter* na=GetNetAdapter();
if (!na) if (!na)
{
emu_printf("Failed to GetNetAdapter()\n"); emu_printf("Failed to GetNetAdapter()\n");
}
else
{
InitNet(na); InitNet(na);
}
return 0; return 0;
} }

View File

@ -56,6 +56,8 @@ void InitNet(NetAdapter* ad)
ResumeThread(rx_thread); ResumeThread(rx_thread);
} }
void TermNet() void TermNet()
{
if(RxRunning)
{ {
RxRunning = false; RxRunning = false;
emu_printf("Waiting for RX-net thread to terminate.."); emu_printf("Waiting for RX-net thread to terminate..");
@ -64,3 +66,4 @@ void TermNet()
delete nif; delete nif;
} }
}