Explorar el Código

fix memory issues

Krešimir Fijačko hace 6 años
padre
commit
341a347a07
Se han modificado 1 ficheros con 3 adiciones y 0 borrados
  1. 3 0
      src/webgl.js

+ 3 - 0
src/webgl.js Ver fichero

@@ -73,6 +73,9 @@ WebGLRenderer.prototype.destroy = function() {
73 73
 	gl.deleteProgram(this.loadingProgram);
74 74
 
75 75
 	gl.deleteBuffer(this.vertexBuffer);
76
+
77
+	gl.getExtension('WEBGL_lose_context').loseContext();
78
+	this.canvas.remove();
76 79
 };
77 80
 
78 81
 WebGLRenderer.prototype.resize = function(width, height) {