@babylonjs/core 7.11.4 → 7.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1715,8 +1715,8 @@ export class AbstractMesh extends TransformNode {
1715
1715
  }
1716
1716
  // Action manager
1717
1717
  if (this.actionManager !== undefined && this.actionManager !== null) {
1718
- // If it's the only mesh using the action manager, dispose of it.
1719
- if (!this._scene.meshes.some((m) => m !== this && m.actionManager === this.actionManager) && this.actionManager.disposeWhenUnowned) {
1718
+ // If we are the only mesh using the action manager, dispose of the action manager too unless it has opted out from that behavior
1719
+ if (this.actionManager.disposeWhenUnowned && !this._scene.meshes.some((m) => m !== this && m.actionManager === this.actionManager)) {
1720
1720
  this.actionManager.dispose();
1721
1721
  }
1722
1722
  this.actionManager = null;