From 2dc509f43d4de23b2a34820e75154a888abb4d3b Mon Sep 17 00:00:00 2001 From: Alasdair Smith Date: Tue, 10 Jul 2018 12:25:13 +0100 Subject: [PATCH] Fix memory leak setting up spell check Switching docs would set up event listeners on Ace without tearing down any old listeners, which could lead to a memory leak. This tears down old listeners when detaching from the "old" doc --- .../web/public/coffee/ide/editor/directives/aceEditor.coffee | 1 + 1 file changed, 1 insertion(+) diff --git a/services/web/public/coffee/ide/editor/directives/aceEditor.coffee b/services/web/public/coffee/ide/editor/directives/aceEditor.coffee index 617b41b845..ed35555196 100644 --- a/services/web/public/coffee/ide/editor/directives/aceEditor.coffee +++ b/services/web/public/coffee/ide/editor/directives/aceEditor.coffee @@ -468,6 +468,7 @@ define [ editor.focus() detachFromAce = (sharejs_doc) -> + tearDownSpellCheck() sharejs_doc.detachFromAce() sharejs_doc.off "remoteop.recordRemote"