mirror of
https://github.com/PCSX2/pcsx2.git
synced 2026-11-17 19:44:19 +01:00
DEV9: fix crash when closing game window with ethernet disabled
This commit is contained in:
1 parent
6186676add
commit
cf58a32583
2 files changed
+5
No files matched your search
@@ -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();
|
||||
|
||||
Reference in new issue
Block a user