diff options
author | Wu Cheng-Han | 2016-07-13 10:41:49 +0800 |
---|---|---|
committer | Wu Cheng-Han | 2016-07-13 10:41:49 +0800 |
commit | b3ba512ceafdf6f6945bc82123fea641b3077570 (patch) | |
tree | a75afdab44f419cde7a91cc0a94a94a329318d95 /lib | |
parent | cb75424f8ea8c164c3762136b6c38eedf189f66a (diff) |
Fix potential memory leaks on realtime client disconnect not clean up server properly
Diffstat (limited to 'lib')
-rw-r--r-- | lib/realtime.js | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/realtime.js b/lib/realtime.js index 25405338..8ff857e1 100644 --- a/lib/realtime.js +++ b/lib/realtime.js @@ -478,6 +478,7 @@ function disconnect(socket) { if (note.server.isDirty) { updateNote(note, function (err, _note) { if (err) return logger.error('disconnect note failed: ' + err); + delete note.server; delete notes[noteId]; if (config.debug) { //logger.info(notes); @@ -487,6 +488,7 @@ function disconnect(socket) { } }); } else { + delete note.server; delete notes[noteId]; } } |