| 247 | } |
| 248 | |
| 249 | dispose(): void { |
| 250 | // First, to prevent updates during disposal. |
| 251 | this._disposed = true; |
| 252 | |
| 253 | for (const [_, subject] of this._subjects) subject.dispose(); |
| 254 | this._subjects.clear(); |
| 255 | |
| 256 | // Last, to clean up anything left after disposal. |
| 257 | this.accessorPool.dispose(); |
| 258 | this.instancedMeshPool.dispose(); |
| 259 | this.lightPool.dispose(); |
| 260 | this.materialPool.dispose(); |
| 261 | this.meshPool.dispose(); |
| 262 | this.nodePool.dispose(); |
| 263 | this.primitivePool.dispose(); |
| 264 | this.skinPool.dispose(); |
| 265 | this.scenePool.dispose(); |
| 266 | this.texturePool.dispose(); |
| 267 | } |
| 268 | } |