Skip to content

Commit b3ba512

Browse files
committed
Fix potential memory leaks on realtime client disconnect not clean up server properly
1 parent cb75424 commit b3ba512

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

lib/realtime.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,7 @@ function disconnect(socket) {
478478
if (note.server.isDirty) {
479479
updateNote(note, function (err, _note) {
480480
if (err) return logger.error('disconnect note failed: ' + err);
481+
delete note.server;
481482
delete notes[noteId];
482483
if (config.debug) {
483484
//logger.info(notes);
@@ -487,6 +488,7 @@ function disconnect(socket) {
487488
}
488489
});
489490
} else {
491+
delete note.server;
490492
delete notes[noteId];
491493
}
492494
}

0 commit comments

Comments
 (0)