Tear down Ace session when aceEditor is destroyed

This cleans up the Ace worker that parses syntax, preventing a memory leak
This commit is contained in:
Alasdair Smith 2018-02-20 16:25:30 +00:00
parent 5e39e61c9b
commit 85ceab5310

View file

@ -430,6 +430,8 @@ define [
scope.$on '$destroy', () ->
if scope.sharejsDoc?
detachFromAce(scope.sharejsDoc)
session = editor.getSession()
session?.destroy()
scope.$emit "#{scope.name}:inited", editor