Просмотр исходного кода

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
Alasdair Smith 8 лет назад
Родитель
Сommit
2dc509f43d
1 измененных файлов с 1 добавлено и 0 удалено
  1. 1 0
      services/web/public/coffee/ide/editor/directives/aceEditor.coffee

+ 1 - 0
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"