Jump to content

Releasing WebGL and Web Audio resources


jsc
 Share

Recommended Posts

It's my understanding from everything I've read online that you don't need to manually free WebGL and Web Audio resources (textures, buffers, etc.) when the page unloads because all resources associated with the page will be unloaded automatically at that point.

 

Just for peace of mind, can anyone confirm that I'm understanding this correctly? Is there any need to free WebGL resources (e.g. using deleteTexture()) or Web Audio resources manually when the page unloads?

Link to comment
Share on other sites

Thanks, Rich. Yes, I'm just talking about unloading the page via normal browser actions like refreshing, navigating away, or closing a tab.

 

I did find this thread, which mentions some issues regarding WebGL and page refresh, but it looks like maybe those issues have been addressed since then.

 

In any case, given that events like 'unload' behave differently on different browsers, it doesn't seem like there's a reliable hook for doing this kind of cleanup anyway. If I have anything wrong, corrections are welcome, but otherwise that answers my question. Thanks for your help :)

Link to comment
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...
 Share

  • Recently Browsing   0 members

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