summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--lib/realtime.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/realtime.js b/lib/realtime.js
index 0fcd2eaa..ea3735a6 100644
--- a/lib/realtime.js
+++ b/lib/realtime.js
@@ -543,6 +543,9 @@ function disconnect(socket) {
if (note.server.isDirty) {
updateNote(note, function (err, _note) {
if (err) return logger.error('disconnect note failed: ' + err);
+ // clear server before delete to avoid memory leaks
+ note.server.document = "";
+ note.server.operations = [];
delete note.server;
delete notes[noteId];
if (config.debug) {