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:
@@ -430,6 +430,8 @@ define [
|
|||||||
scope.$on '$destroy', () ->
|
scope.$on '$destroy', () ->
|
||||||
if scope.sharejsDoc?
|
if scope.sharejsDoc?
|
||||||
detachFromAce(scope.sharejsDoc)
|
detachFromAce(scope.sharejsDoc)
|
||||||
|
session = editor.getSession()
|
||||||
|
session?.destroy()
|
||||||
|
|
||||||
scope.$emit "#{scope.name}:inited", editor
|
scope.$emit "#{scope.name}:inited", editor
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user