Prune queued-card rows whose pooled item paints another entry

A pooled paint item reused by another card keeps a fresh frame stamp, so
rows for cards that stopped painting survived every prune and the index
grew for the whole session. The prune now also drops a row whose item
paints a different entry id or source, and a test pins the bound.
This commit is contained in:
German Khokhlov committed 2026-11-06 14:45:37 +04:00
1 parent da00b096d2
commit 1015b16664
2 files changed
+56 -1

No files matched your search

+9 -1
View File
@@ -2298,7 +2298,15 @@ function addPaintItem(record, placement, temporalAlpha, selected) {
function pruneQueuedItemIndex() {
for (const [sourceId, bySource] of _queuedItemBySource) {
for (const [entryId, item] of bySource) {
if (item.stamp !== _frameStamp) bySource.delete(entryId);
// A pooled item that now paints another entry keeps a fresh stamp.
const entry = item.record.entry;
if (
item.stamp !== _frameStamp ||
entry.id !== entryId ||
entry.source !== sourceId
) {
bySource.delete(entryId);
}
}
if (bySource.size === 0) _queuedItemBySource.delete(sourceId);
}