According to spec buffers and textures should be garbage collected together with JS objects:
Note that underlying GL object will be automatically marked for deletion when the JS object is destroyed, however this method allows authors to mark an object for deletion early.
It looks that browsers that support WebGL also support WeakMap, but just in case I added a test for WeakMap support.
Addresses memory leaks caused by many programmatically created textures and meshes: https://github.com/elm-community/webgl/issues/46
According to spec buffers and textures should be garbage collected together with JS objects:
It looks that browsers that support WebGL also support WeakMap, but just in case I added a test for WeakMap support.