Tidy up wrappers on WebGLRenderer destroy.

This commit is contained in:
Ben Richards 2024-02-02 20:55:09 +13:00
parent 4fd8fc94c3
commit d57b46e690

View file

@ -3169,6 +3169,19 @@ var WebGLRenderer = new Class({
{
this.canvas.removeEventListener('webglcontextlost', this.contextLostHandler, false);
this.canvas.removeEventListener('webglcontextrestored', this.contextRestoredHandler, false);
var wrapperDestroy = function (wrapper)
{
wrapper.destroy();
};
ArrayEach(this.glAttribLocationWrappers, wrapperDestroy);
ArrayEach(this.glBufferWrappers, wrapperDestroy);
ArrayEach(this.glFramebufferWrappers, wrapperDestroy);
ArrayEach(this.glProgramWrappers, wrapperDestroy);
ArrayEach(this.glTextureWrappers, wrapperDestroy);
ArrayEach(this.glUniformLocationWrappers, wrapperDestroy);
this.maskTarget.destroy();
this.maskSource.destroy();