From 858b30c20c5ce555ab023d69bad24d548cdcbc4e Mon Sep 17 00:00:00 2001 From: Wu Cheng-Han Date: Sat, 2 Jul 2016 16:12:48 +0800 Subject: Try to solve potential memory leaks --- lib/realtime.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/realtime.js b/lib/realtime.js index 5de3c565..ad4ae215 100644 --- a/lib/realtime.js +++ b/lib/realtime.js @@ -330,6 +330,8 @@ var disconnectSocketQueue = []; function finishConnection(socket, note, user) { if (!socket || !note || !user) { + if (note) delete note; + if (user) delete user; connectionSocketQueue.pop(); isConnectionBusy = false; return; -- cgit v1.2.3