We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 06fd45d commit fd1e316Copy full SHA for fd1e316
1 file changed
code/core/OS/Net/drivers/TCPDriver.cpp
@@ -41,8 +41,12 @@ namespace OS {
41
iterator.Iterate(LLIterator_TickOrDeleteClient, this);
42
}
43
bool TCPDriver::LLIterator_TickOrDeleteClient(INetPeer* peer, TCPDriver* driver) {
44
+ int ref = peer->GetRefCount();
45
+ if(ref == 0) { //may not yet be deleted
46
+ return true;
47
+ }
48
if (peer->ShouldDelete()) {
- if (peer->GetRefCount() == 1) { //only 1 reference (the drivers reference)
49
+ if (ref == 1) { //only 1 reference (the drivers reference)
50
driver->mp_peers->RemoveFromList(peer);
51
peer->DecRef();
52
peer->CloseSocket(); //this will delete itself
0 commit comments