NetworkSession: remove premature GC optimization

The only cyclic references here are both destroyed during normal collection directly (net interface removes from sessions array, player destroys its session reference), so there's no need to destroy them again here. This just causes a giant swathe of potential crashes for no real benefit.

close #2669
This commit is contained in:
Dylan K. Taylor 2019-01-16 16:50:13 +00:00
parent acdd0fec5f
commit 728bc95d73

View File

@ -342,7 +342,6 @@ class NetworkSession{
}
$this->interface->close($this, $notify ? $reason : "");
$this->disconnectCleanup();
}
/**
@ -355,18 +354,9 @@ class NetworkSession{
if($this->connected){
$this->connected = false;
$this->player->close($this->player->getLeaveMessage(), $reason);
$this->disconnectCleanup();
}
}
private function disconnectCleanup() : void{
$this->handler = null;
$this->interface = null;
$this->player = null;
$this->sendBuffer = null;
$this->compressedQueue = null;
}
public function enableEncryption(string $encryptionKey, string $handshakeJwt) : void{
$pk = new ServerToClientHandshakePacket();
$pk->jwt = $handshakeJwt;