mirror of
https://github.com/brues-code/ClassicAPI.git
synced 2026-11-16 16:10:36 +00:00
Frame::RegionDestruction co-hooks SimpleRegionDestruct (0x77F6F0), the destructor body every region ends in, and runs its listeners first. It has exactly three callers: the base region's deleting destructor (0x77F6C6), ~CSimpleTexture (0x76FD40, a tail JMP; its only caller is the deleting destructor 0x76FD10) and ~CSimpleFontString (0x770E50, a tail JMP; called by its deleting destructor 0x770E20 and by a subclass's, 0x789320). The texture and font string vtables (0x81C718, 0x81C778) are written only by their constructor and destructor, so no inlined destructor skips the hook. It replaces FontString::Destruction, the font-string-only hook from the previous commit; the duration text binding now listens here. InlineTexturePool kept icon state keyed by font string pointer and judged a key alive by its first word matching a vtable it had seen painted. That guess had a hole: a destroyed font string's block goes back to the region pool and can come back as another font string, vtable and all, and the dead key's icons then served the new one. It also read possibly-freed memory on every tick. Now a destroyed key takes its entry with it at once, so the address starts clean; its icon regions live on with their parent frame and are hidden on the next tick, never inside the destructor that reported the death. A destroyed icon region is dropped wherever it is held, and a live key that loses one is placed again. The learned-vtable sets, IsLiveFontString and IsLiveRegion are gone. The SEH latch stays, for the engine region calls the tick makes from paint-time data.