feedback3 WD: a fresh model load also forgets PIXI's pending requests keyed by the absolute URL of the same path (GitHub #68)

This commit is contained in:
sganggs committed 2026-10-04 17:43:32 +08:00
1 parent 207a49103f
commit 28a00e0f33
2 files changed
+6 -2

No files matched your search

+3 -2
View File
@@ -573,9 +573,10 @@ export function forgetPendingSpine(entry, keep) {
const done = (u) => { try { return !!PIXI.Assets.cache?.has?.(u); } catch { return true; } };
if (done(skel)) return 0;
const atlas = (typeof entry.atlas === 'string' && entry.atlas) || skel.replace(/\.skel$/, '.atlas');
const urls = done(atlas) ? [skel] : [skel, atlas, ...spinePages(entry)];
const urls = (done(atlas) ? [skel] : [skel, atlas, ...spinePages(entry)]).filter((u) => !(keep && keep.has(u)));
let n = 0;
for (const u of urls) if (!(keep && keep.has(u)) && Object.hasOwn(cache, u)) { delete cache[u]; n++; }
// the loader keys its cache by the resolved URL: the manifest path itself, or that path made absolute
for (const key of Object.keys(cache)) if (urls.some((u) => key === u || (u.startsWith('/') && key.endsWith(u)))) { delete cache[key]; n++; }
return n;
}