jsc Posted June 3, 2015 Share Posted June 3, 2015 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? Quote Link to comment Share on other sites More sharing options...
rich Posted June 4, 2015 Share Posted June 4, 2015 As long as the page does actually unload, i.e. fully navigates away to another page / site, then yes you are right. If you're trying something more clever, like a forced page refresh, iframe unload, etc then it may be a different story. Quote Link to comment Share on other sites More sharing options...
jsc Posted June 5, 2015 Author Share Posted June 5, 2015 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.