Pārlūkot izejas kodu

fix memory issues

Krešimir Fijačko 7 gadus atpakaļ
vecāks
revīzija
341a347a07
1 mainītis faili ar 3 papildinājumiem un 0 dzēšanām
  1. 3 0
      src/webgl.js

+ 3 - 0
src/webgl.js Parādīt failu

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