Search the Community
Showing results for tags 'pixi-v8'.
-
Hello, I'm running into some unexpected caching behavior with Spine in PixiJS. Package versions: "pixi.js": "8.17.1" "@esotericsoftware/spine-pixi-v8": "4.2.107" Code example: // STEP 1 — Load bundle await Assets.loadBundle('preloader'); // Assets are now available console.log([...Cache.keys()]); // = ['logoSkeleton', 'logoAtlas'] Assets.cache.has('logoSkeleton'); // = true Assets.cache.has('logoAtlas'); // = true // STEP 2 — Create first Spine instance const spine = Spine.from({ skeleton: 'logoSkeleton', atlas: 'logoAtlas' }); // Cache AFTER creating Spine // record 'logoSkeleton-logoAtlas-1' added by Spine.from() console.log([...Cache.keys()]); // = ['logoSkeleton', 'logoAtlas', 'logoSkeleton-logoAtlas-1'] Assets.cache.has('logoSkeleton') ; // = true Assets.cache.has('logoAtlas'); // = true Assets.cache.has('logoSkeleton-logoAtlas-1'); // = true // STEP 3 — Unload bundle await Assets.unloadBundle('preloader'); // Verify Assets cache is cleared Assets.cache.has('logoSkeleton'); // = false Assets.cache.has('logoAtlas'); // = false Assets.cache.has('logoSkeleton-logoAtlas-1'); // = true !!! // Check Cache after unload console.log([...Cache.keys()]); // = ['logoSkeleton-logoAtlas-1'] // ! Unload did not remove 'logoSkeleton-logoAtlas-1' from Cache // STEP 4 — Create second Spine instance, // still works because 'logoSkeleton-logoAtlas-1' is in Cache, // even though original assets were unloaded spine2 = Spine.from({ skeleton: 'logoSkeleton', atlas: 'logoAtlas' }); Expected behavior: Spine.from() should throw because assets were unloaded. I would expect that unloading a bundle remove all related assets => proper memory management. I’ve confirmed that this works, but it doesn’t seem maintainable or flexible for future extensions: Cache.remove('logoSkeleton-logoAtlas-1'); Any guidance?
-
Hello, I'm running into some unexpected caching behavior with Spine in PixiJS v8. Package versions: "pixi.js": "8.17.1" "@esotericsoftware/spine-pixi-v8": "4.2.107" Example: // STEP 1 — Load bundle await Assets.loadBundle('preloader'); // Assets are now available console.log([...Cache.keys()]); // = ['logoSkeleton', 'logoAtlas'] Assets.cache.has('logoSkeleton'); // = true Assets.cache.has('logoAtlas'); // = true // STEP 2 — Create first Spine instance const spine = Spine.from({ skeleton: 'logoSkeleton', atlas: 'logoAtlas' }); // Cache AFTER creating Spine // record 'logoSkeleton-logoAtlas-1' added by Spine.from() console.log([...Cache.keys()]); // = ['logoSkeleton', 'logoAtlas', 'logoSkeleton-logoAtlas-1'] Assets.cache.has('logoSkeleton') ; // = true Assets.cache.has('logoAtlas'); // = true Assets.cache.has('logoSkeleton-logoAtlas-1'); // = true // STEP 3 — Unload bundle await Assets.unloadBundle('preloader'); // Verify Assets cache is cleared Assets.cache.has('logoSkeleton'); // = false Assets.cache.has('logoAtlas'); // = false Assets.cache.has('logoSkeleton-logoAtlas-1'); // = true !!! // Check Cache after unload console.log([...Cache.keys()]); // = ['logoSkeleton-logoAtlas-1'] // ! Unload did not remove 'logoSkeleton-logoAtlas-1' from Cache // STEP 4 — Create second Spine instance, // still works because 'logoSkeleton-logoAtlas-1' is in Cache, // even though original assets were unloaded spine2 = Spine.from({ skeleton: 'logoSkeleton', atlas: 'logoAtlas' }); I would expect that unloading a bundle remove all related assets. Why is this not the case? Do I need to implement a workaround? I’ve confirmed that this works, but it doesn’t seem maintainable or flexible for a larger codebase: Cache.remove('logoSkeleton-logoAtlas-1');
