village-builder

VB-441: The page frees a rebuilt farm’s drawings (quick start at the uncapped speed ran out of memory)

Status: done (2026-11-15) Priority: 1 Size: S Design ref: none (the page’s drawing; src/page/settlement.js, buildFarms and clearSettlement) Goal: buildFarms takes down and redraws every farm, fence and pawn when the simulation marks a change, and destroyed what it took down with destroy({ children: true }). In PixiJS 8 that leaves each Graphics’ own context alive (Graphics.destroy frees it only with no options, true or { context: true }), and the renderer’s cache of contexts (graphicsContext._gpuContextHash) then keeps the geometry of every fence and house ever drawn. On the quick start at the uncapped speed the tab’s heap passed 1.4 GB by year 3 and the tab died within a few years (Kim, 14 November). The drawings are destroyed with their contexts. Acceptance criteria: