fix(refboard): reference-counted textures prevent shared source crash
When duplicated images share the same assetKey, Assets.unload() was destroying the shared texture source — crashing all sprites using it (null addressModeU/alphaMode in WebGL renderer). TextureManager now tracks refCount per asset. Only calls Assets.unload() when the last reference is released. ImageSprite calls release() instead of unload() on texture teardown.
This commit is contained in:
@@ -113,7 +113,7 @@ export class ImageSprite extends Container {
|
||||
unloadTexture(): void {
|
||||
if (!this.loaded) return;
|
||||
|
||||
this.textures.unload(this.assetKey);
|
||||
this.textures.release(this.assetKey);
|
||||
|
||||
// Remove sprite from display tree entirely — avoids PixiJS v8 render crash
|
||||
if (this._sprite) {
|
||||
|
||||
Reference in New Issue
Block a user