Jump to content

Phaser context coming up null when creating buffer


conradk
 Share

Recommended Posts

Hey everyone,

 

I am a little new to phaser but I am currently having a problem that I am sure not many of you would have encountered due to its uniqueness.

 

so right now I am creating a game that needs to be destroyed a number of times. The reason I do this is because after I destroy the game the players will view the high scores of other players (multiplayer games) and  that it accomplished by routes without reloading. after a duration I will be routed back to a new instance of the game.

 

I have pin pointed the error from logs. It comes from the this.context.createBuffer in the unlock function. For some reason after the 5th time I create a game and I do a mouse click i get an error when phaser tries to create the buffer due to context being null. TypeError: null is not an object (evaluating 'this.context.createBuffer'). Would this be some memory leaks?

 

Every time the game finishes I call destroy on the game to clean up resources and set it to null for garbage collection, but as of now I am stumped. 

 

Can anyone help???

 

Thank you!

 

:)

 

 

Link to comment
Share on other sites

It's exhausted the number of AudioContext's available for your audio hardware / browser.

 

I'm not actually currently aware of a way to cleanly remove an AudioContext from the browser once used, but if anyone knows I'll try it out. Setting it off to null or whatever doesn't seem to do it, so there may be another method.

Link to comment
Share on other sites

  • 2 weeks later...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...