mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-07 08:09:01 +02:00
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:
@@ -468,6 +468,7 @@ define [
|
||||
editor.focus()
|
||||
|
||||
detachFromAce = (sharejs_doc) ->
|
||||
tearDownSpellCheck()
|
||||
sharejs_doc.detachFromAce()
|
||||
sharejs_doc.off "remoteop.recordRemote"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user