Fix demand-loaded building artwork ownership - #5
Conversation
|
Had Claude review it: Reviewed the ownership model this change establishes — demand-loaded art is owned by the type and freed with Two paths still leave an archive-owned pointer under an owning flag, so the original crash survives the fix. Blocking1.
After loading a save, a Skipping the re-fetch isn't enough; the pointer has to be detached: if (IsDemandLoad) {
ImageData = NULL;
} else {
Fetch_Normal_Image();
}2. No
Needs the symmetric 3. The change record targets a released version
Worth addressing
Leaving The They sit above Documentation accuracy
Follow-up (not this PR)Only three classes carry a demand-load flag, and the other two have the same defects: Since every base-class write of All static analysis against the PR head; I didn't build or run it. |
Summary
Fix demand-loaded building artwork ownership and deallocation, preventing heap corruption in mods such as TFADW.
Behavior and compatibility
Bug fix for
DemandLoad,DemandLoadBuildup, andFreeBuildup. No format, save, replay, networking, determinism, COM, or ABI changes.Validation
UnitCount=1.Documentation
Updated the affected key documentation, MIX ownership guidance, and change record.
Checklist