Repository navigation
Conversation
Long sessions grew by hundreds of MB per hour. Orphaned skeletons (with their bone textures) and animation groups piled up in the scene because: - ModelObject.load only disposed the old clone's mesh; the cloned skeleton and its clips stayed in the scene. It now uses disposeGltf. - A load overtaken by a newer one (Pet, GM mark, equipment parts, band instruments) or whose entity had already gone returned without freeing the freshly cloned model. It now calls disposeLoadedModel. - Hero.syncPlayerAppearance set charAppearance.changed on every inventory change (potion drunk, loot picked up, item moved), so each one re-dressed ~10 parts. It now only does so when what is worn (model, level, excellent/ancient, sockets) actually changes. Reproduced offline: 120 quick swaps left 128 orphaned skeletons and animation groups went 114 -> 1054; with the fix, 0 orphans. Tests: src/controllers/render/modelSwapLeak.test.ts (fail without the fix).
openmubr
force-pushed
the
pr/model-swap-leak
branch
from
November 8, 2026 13:12
fe55dbc to
c926e0b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Long sessions grew by hundreds of MB per hour. Orphaned skeletons (with their bone textures) and animation groups piled up in the scene, for three reasons:
ModelObject.loadonly disposed the old clone's mesh, so the cloned skeleton and its clips stayed in the scene. It now usesdisposeGltf.disposeLoadedModel.Hero.syncPlayerAppearancesetcharAppearance.changedon every inventory change (a potion drunk, loot picked up, an item moved in the vault), so each one re-dressed about 10 parts. It now only does so when what is worn (model, level, excellent/ancient, sockets) actually changes.Reproduced offline: 120 quick swaps left 128 orphaned skeletons and animation groups went 114 -> 1054; with the fix there are 0 orphans.
Tests:
src/controllers/render/modelSwapLeak.test.ts(3 cases, all fail without the fix). vitest onsrc/controllers/render,src/ecs/systemsandsrc/modules/heropasses (32 files, 216 tests);tscshows only the existinginstall/clierrors.🤖 Generated with Claude Code