I’ve added WebGL context to the iframe element and then found out that refreshing that iframe page resulted in significant memory decrease in Chrome as I watched it using dev tools (garbage collection kicking in?). As far as I know, this is the only way of “deleting” WebGL context on Chrome (but I am still not sure as I’m not aware of what Chrome is actually doing)
I agree and have myself sometimes pondered about how to kill a context explicitly, and there's no way other than to release refs to all GL objects and leave it to the GC. It would be nice to have an explicit API, although the lose_context extension is not it (and shouldn't be), because it matches the resource loss semantics from the system, to solve another problem, and not the context itself. It would be nice to have a deleteContext() feature, since otherwise getContext()ing something effectively "taints" the <canvas> and ties it to that context type for its remaining lifetime, which is a bit messy. Not critical, but agree this is a bit dirty part if the API.
On Nov 7, 2016 4:24 PM, "Ryan Patterson" <email@example.com> wrote: