Browse Source

fix memory issues

Krešimir Fijačko 7 years ago
parent
commit
341a347a07
1 changed files with 3 additions and 0 deletions
  1. 3 0
      src/webgl.js

+ 3 - 0
src/webgl.js View File

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