Fix view not cleaning some variables

This commit is contained in:
LoveEevee 2018-10-25 18:50:10 +03:00
parent f90f6fe6e1
commit 378e275372
2 changed files with 22 additions and 11 deletions

View File

@ -1286,11 +1286,13 @@
return this.controller.getElapsedTime()
}
clean(){
this.draw.clean()
this.assets.clean()
this.titleCache.clean()
this.comboCache.clean()
if(this.multiplayer !== 2){
pageEvents.remove(window, "resize")
}
if(this.touchEnabled){
pageEvents.remove(this.canvas, "touchstart")
pageEvents.remove(this.touchFullBtn, "touchend")
@ -1302,6 +1304,8 @@
delete this.touchFullBtn
delete this.touchPauseBtn
}
}
pageEvents.mouseRemove(this)
delete this.pauseMenu
delete this.cursor
delete this.gameDiv

View File

@ -131,4 +131,11 @@ class ViewAssets{
asset.changeBeatInterval(beatMS, initial)
})
}
clean(){
delete this.ctx
delete this.don
delete this.fire
delete this.fireworks
delete this.allAssets
}
}