Parcourir la source

Tear down Ace session when aceEditor is destroyed

This cleans up the Ace worker that parses syntax, preventing a memory leak
Alasdair Smith il y a 8 ans
Parent
commit
85ceab5310

+ 2 - 0
services/web/public/coffee/ide/editor/directives/aceEditor.coffee

@@ -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