mirror of https://github.com/status-im/codimd.git
Try to fix memory leaks by clear OT server before disconnect note
This commit is contained in:
parent
138aa876f4
commit
b734eb9c85
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue