Fixed some memory leaks.
This commit is contained in:
parent
4b88296265
commit
4c7d7fce03
3 changed files with 10 additions and 6 deletions
app
|
@ -161,6 +161,7 @@ module.exports = class SpriteBoss extends CocoClass
|
|||
thang = sprite.thang
|
||||
delete @sprites[sprite.thang.id]
|
||||
@spriteArray.splice @spriteArray.indexOf(sprite), 1
|
||||
@stopListening sprite
|
||||
sprite.destroy()
|
||||
sprite.thang = thang # Keep around so that we know which thang the destroyed thang was for
|
||||
|
||||
|
|
|
@ -62,7 +62,9 @@ module.exports = class ThangType extends CocoModel
|
|||
@options = @fillOptions options
|
||||
key = @spriteSheetKey(@options)
|
||||
if ss = @spriteSheets[key] then return ss
|
||||
return key if @building[key]
|
||||
if @building[key]
|
||||
@options = null
|
||||
return key
|
||||
@t0 = new Date().getTime()
|
||||
@initBuild(options)
|
||||
@addGeneralFrames() unless @options.portraitOnly
|
||||
|
@ -159,6 +161,7 @@ module.exports = class ThangType extends CocoModel
|
|||
@spriteSheets[key] = spriteSheet
|
||||
delete @building[key]
|
||||
@builder = null
|
||||
@options = null
|
||||
spriteSheet
|
||||
|
||||
onBuildSpriteSheetComplete: (e, data) ->
|
||||
|
|
Reference in a new issue