Skip to content

Commit f35427b

Browse files
authored
Merge pull request #11 from pdsinterop/fix/memory-leak
unset the client from the list on disconnect to fix memory usage
2 parents d216a15 + 0d6dcb3 commit f35427b

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎server/server.php‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ public function onClose(
118118
}
119119
}
120120
}
121+
unset($this->clients[$connection->getRemoteName()]);
121122
}
122123

123124
public function onDisconnect(
@@ -133,6 +134,7 @@ public function onDisconnect(
133134
}
134135
}
135136
}
137+
unset($this->clients[$connection->getRemoteName()]);
136138
}
137139

138140
public function onError(
@@ -151,6 +153,7 @@ public function onError(
151153
}
152154
}
153155
}
156+
unset($this->clients[$connection->getRemoteName()]);
154157
}
155158

156159
public function createServer() {
@@ -225,4 +228,4 @@ public function createServer() {
225228
}
226229
}
227230

228-
$server = new SolidPubSub($options);
231+
$server = new SolidPubSub($options);

0 commit comments

Comments
 (0)