conradk

Phaser context coming up null when creating buffer

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!

 

:)

 

 

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.