sifon Posted January 26, 2016 Share Posted January 26, 2016 Hi, I have found a bug in the Phaser framework. I have a system to play different games, so I have a menu where the user can select a game and, after playing 1 minute, go back to the menu and select other game (or the same). When the user finish the game, I use "game.destroy()" to delete all content. To save memory, I'm reusing the game object and I'm saving the Phaser object in a variable, so from the second time the Phaser object is the same: if (taskGame) { game = taskGame; game.state = new Phaser.StateManager(game, { preload: preload, create: create, update: update }); game.boot(); } else { taskGame = game = new Phaser.Game(1920, 1080, Phaser.AUTO, "taskContainer", { preload: preload, create: create, update: update }, true); } The problem is the following, when the user plays six times everything is OK but when playing the seven I'm getting this error during the loading of the game: Quote Uncaught TypeError: Cannot read property 'load' of null playThroughEvent @ phaser.js:70623 I have been investigating the Phaser code and I have detected that the problem is, in the preloader, when is loading the sounds, in line 70439, game.sound.usingWebAudio is false, when the other six times is true: Why after running destroy() and boot() six times, usingWebAudio is false? Can somebody help me? Thanks! Link to comment Share on other sites More sharing options...
sifon Posted February 26, 2016 Author Share Posted February 26, 2016 I don't know if the fix was related to this topic since nobody answered me but I have tested 2.4.6 Baerlon and this issue is not happening, so it's fixed for me. Link to comment Share on other sites More sharing options...
Recommended Posts