Skip to content

Commit

Permalink
Merge pull request #50 from edhelas/master
Browse files Browse the repository at this point in the history
Set the socket and buffer in SocketWrapper to null on close
  • Loading branch information
WyriHaximus authored May 18, 2018
2 parents cf36924 + a21edf4 commit 638f9fa
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/SocketWrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class SocketWrapper extends EventEmitter
/**
* @var ZMQSocket|null
*/
protected $socket;
protected $socket = null;

/**
* @var LoopInterface
Expand All @@ -35,7 +35,7 @@ class SocketWrapper extends EventEmitter
/**
* @var Buffer|null
*/
protected $buffer;
protected $buffer = null;

/**
* @param ZMQSocket $socket
Expand Down Expand Up @@ -140,8 +140,8 @@ public function close()
$this->loop->removeReadStream($this->fileDescriptor);
$this->buffer->removeAllListeners();
$this->removeAllListeners();
unset($this->buffer);
unset($this->socket);
$this->buffer = null;
$this->socket = null;
$this->closed = true;
}

Expand Down

0 comments on commit 638f9fa

Please sign in to comment.