Skip to content

Commit 89d5d9b

Browse files
authored
Hopefully this can fix memory leaks
1 parent 61cd61c commit 89d5d9b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

server-src/rtcsignal/req-handler.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ function fakeIoCreate() {
3434
var io = fakeIO({ noServer: true });
3535
var connectedCount = 0;
3636
io.on("connection", (socket) => {
37+
clearTimeout(io.destroyTimeout);
3738
connectedCount += 1;
3839
const connectedUser = {
3940
id: socket.id,
@@ -139,6 +140,9 @@ function newHostThing(val) {
139140
host.close();
140141
delete hosts[key];
141142
};
143+
host.destroyTimeout = setTimeout(() => {
144+
host.endFunction();
145+
},1000*30); //half of a minute.
142146
hosts[key] = host;
143147
return key;
144148
}

0 commit comments

Comments
 (0)