Browse Source

WebGLRenderer: Enhance .dispose()

Mugen87 7 years ago
parent
commit
11a117aad4

+ 2 - 0
src/renderers/WebGLRenderer.js

@@ -510,6 +510,8 @@ function WebGLRenderer( parameters ) {
 		_canvas.removeEventListener( 'webglcontextrestored', onContextRestore, false );
 
 		renderLists.dispose();
+		properties.dispose();
+		objects.dispose();
 
 		vr.dispose();
 

+ 2 - 2
src/renderers/webgl/WebGLObjects.js

@@ -33,7 +33,7 @@ function WebGLObjects( geometries, infoRender ) {
 
 	}
 
-	function clear() {
+	function dispose() {
 
 		updateList = {};
 
@@ -42,7 +42,7 @@ function WebGLObjects( geometries, infoRender ) {
 	return {
 
 		update: update,
-		clear: clear
+		dispose: dispose
 
 	};
 

+ 2 - 2
src/renderers/webgl/WebGLProperties.js

@@ -28,7 +28,7 @@ function WebGLProperties() {
 
 	}
 
-	function clear() {
+	function dispose() {
 
 		properties = {};
 
@@ -37,7 +37,7 @@ function WebGLProperties() {
 	return {
 		get: get,
 		remove: remove,
-		clear: clear
+		dispose: dispose
 	};
 
 }