mirror of https://github.com/PCSX2/pcsx2.git
DEV9: fix crash when closing game window with ethernet disabled
This commit is contained in:
parent
6186676add
commit
cf58a32583
|
@ -280,6 +280,7 @@ TAPAdapter::TAPAdapter()
|
|||
write.Offset = 0;
|
||||
write.OffsetHigh = 0;
|
||||
write.hEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
|
||||
isActive = true;
|
||||
|
||||
|
||||
}
|
||||
|
@ -379,10 +380,13 @@ bool TAPAdapter::send(NetPacket* pkt)
|
|||
}
|
||||
TAPAdapter::~TAPAdapter()
|
||||
{
|
||||
if (!isActive)
|
||||
return;
|
||||
CloseHandle(read.hEvent);
|
||||
CloseHandle(write.hEvent);
|
||||
TAPSetStatus(htap, FALSE);
|
||||
CloseHandle(htap);
|
||||
isActive = false;
|
||||
}
|
||||
|
||||
//i leave these for reference, in case we need msth :p
|
||||
|
|
|
@ -29,6 +29,7 @@ class TAPAdapter : public NetAdapter
|
|||
{
|
||||
HANDLE htap;
|
||||
OVERLAPPED read,write;
|
||||
bool isActive = false;
|
||||
public:
|
||||
TAPAdapter();
|
||||
virtual bool blocks();
|
||||
|
|
Loading…
Reference in New Issue