DEV9: fix crash when closing game window with ethernet disabled

This commit is contained in:
GovanifY authored and refractionpcsx2 committed 2020-10-03 23:47:04 +01:00
1 parent 6186676add
commit cf58a32583
2 files changed
+5

No files matched your search

+4
View File
@@ -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
+1
View File
@@ -29,6 +29,7 @@ class TAPAdapter : public NetAdapter
{
HANDLE htap;
OVERLAPPED read,write;
bool isActive = false;
public:
TAPAdapter();
virtual bool blocks();