mirror of https://github.com/PCSX2/pcsx2.git
Merge pull request #52 from Bigpet/master
Dev9 plugin - prevent null dereference if no device is set
This commit is contained in:
commit
71ebb2493e
|
@ -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");
|
||||||
InitNet( na);
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
InitNet(na);
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -57,10 +57,13 @@ void InitNet(NetAdapter* ad)
|
||||||
}
|
}
|
||||||
void TermNet()
|
void TermNet()
|
||||||
{
|
{
|
||||||
RxRunning=false;
|
if(RxRunning)
|
||||||
emu_printf("Waiting for RX-net thread to terminate..");
|
{
|
||||||
WaitForSingleObject(rx_thread,-1);
|
RxRunning = false;
|
||||||
emu_printf(".done\n");
|
emu_printf("Waiting for RX-net thread to terminate..");
|
||||||
|
WaitForSingleObject(rx_thread, -1);
|
||||||
|
emu_printf(".done\n");
|
||||||
|
|
||||||
delete nif;
|
delete nif;
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue