mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-04-01 15:50:11 -04:00
Couple teardown fixes.
This commit is contained in:
parent
df1c72d132
commit
d65ade7a97
2 changed files with 4 additions and 2 deletions
app
|
@ -223,6 +223,7 @@ module.exports = LayerAdapter = class LayerAdapter extends CocoClass
|
|||
|
||||
_renderNewSpriteSheet: (async) ->
|
||||
@asyncBuilder.stopAsync() if @asyncBuilder
|
||||
@asyncBuilder = null
|
||||
|
||||
async ?= @buildAsync
|
||||
builder = new createjs.SpriteSheetBuilder()
|
||||
|
@ -274,7 +275,7 @@ module.exports = LayerAdapter = class LayerAdapter extends CocoClass
|
|||
return sheet
|
||||
|
||||
onBuildSpriteSheetComplete: (e, builder) ->
|
||||
return if @initializing
|
||||
return if @initializing or @destroyed
|
||||
@asyncBuilder = null
|
||||
|
||||
if builder.spriteSheet._images.length > 1
|
||||
|
@ -506,4 +507,5 @@ module.exports = LayerAdapter = class LayerAdapter extends CocoClass
|
|||
|
||||
destroy: ->
|
||||
child.destroy?() for child in @container.children
|
||||
@asyncBuilder.stopAsync() if @asyncBuilder
|
||||
super()
|
|
@ -212,7 +212,7 @@ module.exports = class ThangsTabView extends CocoView
|
|||
|
||||
destroy: ->
|
||||
@selectAddThangType null
|
||||
@surface.destroy()
|
||||
@surface?.destroy()
|
||||
$(window).off 'resize', @onWindowResize
|
||||
$(document).unbind 'contextmenu', @preventDefaultContextMenu
|
||||
@thangsTreema?.destroy()
|
||||
|
|
Loading…
Add table
Reference in a new issue