mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-22 17:56:30 -05:00
Try to fix memory leaks by clear OT server before disconnect note
This commit is contained in:
parent
138aa876f4
commit
b734eb9c85
1 changed files with 3 additions and 0 deletions
|
@ -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 a new issue