dispose method

void dispose()

Frees the GPU-related resources allocated by this instance. Call this method whenever this instance is no longer used in your app.

Implementation

void dispose() {
  if(disposed) return;
  disposed = true;

  dispatchEvent(Event(type: "dispose"));

  if(attributes.isNotEmpty){
    for(final temp in attributes.keys){
      (attributes[temp] as BaseBufferAttribute?)?.dispose();
    }
  }

  if(morphAttributes.isNotEmpty){
    for(final temp in morphAttributes.keys){
      (morphAttributes[temp] as BaseBufferAttribute?)?.dispose();
    }
  }
}