mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-27 09:35:39 -05:00
Reclaim some memory from the verifier.
This commit is contained in:
parent
3ea562780d
commit
5af695494c
2 changed files with 16 additions and 1 deletions
|
@ -94,6 +94,7 @@ module.exports = class VerifierTest extends CocoClass
|
|||
@lastFrameHash = e.lastFrameHash
|
||||
@state = 'complete'
|
||||
@updateCallback? state: @state
|
||||
@scheduleCleanup()
|
||||
|
||||
isSucessful: () ->
|
||||
return false unless @solution?
|
||||
|
@ -112,11 +113,13 @@ module.exports = class VerifierTest extends CocoClass
|
|||
@error = "Failed due to non-user-code problem: #{JSON.stringify(e)}"
|
||||
@state = 'error'
|
||||
@updateCallback? state: @state
|
||||
@scheduleCleanup()
|
||||
|
||||
fail: (e) ->
|
||||
@error = 'Failed due to infinate loop.'
|
||||
@state = 'error'
|
||||
@updateCallback? state: @state
|
||||
@scheduleCleanup()
|
||||
|
||||
generateSpellsObject: ->
|
||||
aetherOptions = createAetherOptions functionName: 'plan', codeLanguage: @session.get('codeLanguage')
|
||||
|
@ -129,3 +132,15 @@ module.exports = class VerifierTest extends CocoClass
|
|||
console.log "Couldn't transpile!\n#{source}\n", e
|
||||
spellThang.aether.transpile ''
|
||||
spells
|
||||
|
||||
scheduleCleanup: ->
|
||||
setTimeout @cleanup, 100
|
||||
|
||||
cleanup: =>
|
||||
if @god
|
||||
console.log "Destorying God"
|
||||
@stopListening @god
|
||||
@god.destroy()
|
||||
console.log "Destoryed"
|
||||
|
||||
@world = null
|
||||
|
|
|
@ -26,7 +26,7 @@ module.exports = class VerifierView extends RootView
|
|||
'patrol-buster', 'endangered-burl', 'thumb-biter', 'gems-or-death', 'village-guard', 'thornbush-farm',
|
||||
'back-to-back', 'ogre-encampment', 'woodland-cleaver', 'shield-rush', 'range-finder', 'munchkin-swarm',
|
||||
'stillness-in-motion', 'the-agrippa-defense', 'backwoods-bombardier', 'coinucopia', 'copper-meadows',
|
||||
'drop-the-flag', 'mind-the-trap', 'signal-corpse', 'rich-forager', 'cross-bones'
|
||||
'drop-the-flag', 'mind-the-trap', 'signal-corpse', 'rich-forager'
|
||||
]
|
||||
|
||||
#testLevels = testLevels.slice 0, 15
|
||||
|
|
Loading…
Reference in a new issue