Browse Source

WebGLGeometries: Clean up

Mugen87 6 năm trước cách đây
mục cha
commit
c1949864b2
1 tập tin đã thay đổi với 7 bổ sung1 xóa
  1. 7 1
      src/renderers/webgl/WebGLGeometries.js

+ 7 - 1
src/renderers/webgl/WebGLGeometries.js

@@ -159,7 +159,13 @@ function WebGLGeometries( gl, attributes, info ) {
 
 		attributes.update( attribute, gl.ELEMENT_ARRAY_BUFFER );
 
-		if ( wireframeAttributes[ geometry.id ] ) attributes.remove( wireframeAttributes[ geometry.id ] );
+		//
+
+		var previousAttribute = wireframeAttributes[ geometry.id ];
+
+		if ( previousAttribute ) attributes.remove( previousAttribute );
+
+		//
 
 		wireframeAttributes[ geometry.id ] = attribute;