Sfoglia il codice sorgente

Merge pull request #274 from kresimirfijacko/fix-memory-leaks

Dominic Szablewski 6 anni fa
parent
commit
1f9b67964a
No account linked to committer's email
1 ha cambiato i file con 3 aggiunte e 0 eliminazioni
  1. 3 0
      src/webgl.js

+ 3 - 0
src/webgl.js Vedi File

@@ -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) {