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
This commit is contained in:
Alasdair Smith 2018-07-10 12:25:13 +01:00
parent 158cb58e29
commit 2dc509f43d

View file

@ -468,6 +468,7 @@ define [
editor.focus()
detachFromAce = (sharejs_doc) ->
tearDownSpellCheck()
sharejs_doc.detachFromAce()
sharejs_doc.off "remoteop.recordRemote"