|
|
@@ -186,8 +186,9 @@ class Geometries extends DataMap {
|
|
|
|
|
|
this.info.memory.geometries --;
|
|
|
|
|
|
+ // index
|
|
|
+
|
|
|
const index = geometry.index;
|
|
|
- const geometryAttributes = renderObject.getAttributes();
|
|
|
|
|
|
if ( index !== null ) {
|
|
|
|
|
|
@@ -195,12 +196,16 @@ class Geometries extends DataMap {
|
|
|
|
|
|
}
|
|
|
|
|
|
- for ( const geometryAttribute of geometryAttributes ) {
|
|
|
+ // geometry attributes
|
|
|
+
|
|
|
+ for ( const attribute of Object.values( geometry.attributes ) ) {
|
|
|
|
|
|
- this.attributes.delete( geometryAttribute );
|
|
|
+ this.attributes.delete( attribute );
|
|
|
|
|
|
}
|
|
|
|
|
|
+ // wireframe attributes
|
|
|
+
|
|
|
const wireframeAttribute = this.wireframes.get( geometry );
|
|
|
|
|
|
if ( wireframeAttribute !== undefined ) {
|
|
|
@@ -209,6 +214,22 @@ class Geometries extends DataMap {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ // node attributes (TODO: Remove this bit once we support BufferAttribute.dispose())
|
|
|
+
|
|
|
+ const currentAttributes = new Set( Object.values( renderObject.geometry.attributes ) );
|
|
|
+
|
|
|
+ for ( const attribute of renderObject.getAttributes() ) {
|
|
|
+
|
|
|
+ if ( currentAttributes.has( attribute ) === false ) {
|
|
|
+
|
|
|
+ this.attributes.delete( attribute );
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ //
|
|
|
+
|
|
|
geometry.removeEventListener( 'dispose', onDispose );
|
|
|
|
|
|
this._geometryDisposeListeners.delete( geometry );
|