Revert "Fixed a memory leak when a connection is closed the topics should also be removed if they are empty"
This reverts commit c089aea8eb
.
This commit is contained in:
parent
e1dba72254
commit
c86fdadcde
@ -77,11 +77,8 @@ class TopicManager implements WsServerInterface, WampServerInterface {
|
||||
public function onClose(ConnectionInterface $conn) {
|
||||
$this->app->onClose($conn);
|
||||
|
||||
foreach ($this->topicLookup as $topic => $storage) {
|
||||
$storage->remove($conn);
|
||||
if (0 === $storage->count()) {
|
||||
unset($this->topicLookup[$topic]);
|
||||
}
|
||||
foreach ($this->topicLookup as $topic) {
|
||||
$topic->remove($conn);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -166,19 +166,12 @@ class TopicManagerTest extends \PHPUnit_Framework_TestCase {
|
||||
$method = $class->getMethod('getTopic');
|
||||
$method->setAccessible(true);
|
||||
|
||||
$attribute = $class->getProperty('topicLookup');
|
||||
$attribute->setAccessible(true);
|
||||
|
||||
$topic = $method->invokeArgs($this->mngr, array($name));
|
||||
|
||||
$this->assertCount(1, $attribute->getValue($this->mngr));
|
||||
|
||||
$this->mngr->onSubscribe($this->conn, $name);
|
||||
$this->mngr->onClose($this->conn);
|
||||
|
||||
$this->assertFalse($topic->has($this->conn));
|
||||
|
||||
$this->assertCount(0, $attribute->getValue($this->mngr));
|
||||
}
|
||||
|
||||
public function testOnErrorBubbles() {
|
||||
|
Loading…
Reference in New Issue
Block a user