Skip to content

Fix Thera/Turnur markers accumulating on every region map refresh - #216

Merged
Slazanger merged 1 commit into
Slazanger:masterfrom
cyber-biscuits:fix/thera-turnur-marker-leak
Nov 6, 2026
Merged

Slazanger merged 1 commit into
Slazanger:masterfrom
cyber-biscuits:fix/thera-turnur-marker-leak

Conversation

@cyber-biscuits

Copy link
Copy Markdown
Contributor

Fixes #215. Related: #145.

Effect on the player

The region map no longer gets slower the longer SMT runs when the open region has a Thera or Turnur exit. Panning, zooming and following your character stay responsive across a long session, and the CPU and memory creep that came with it is gone.

What changed

Two lines in AddWHLinksSystemsToMap(): each Thera and Turnur marker is now added to DynamicMapElements right after MainCanvas.Children.Add(...), the same pattern the sov-fight, storm, POI and highlight markers already use. The 2-second partial redraw therefore removes the previous markers before the routine recreates them, so the canvas holds one marker per exit instead of one per tick.

Verification

  • Root cause confirmed on a degraded SMT 1.49 instance: a heap dump showed 4,512 live Ellipse objects in the map canvas, one per refresh tick since a Turnur exit appeared in the open region. Details and the overnight measurements are in Map gets progressively laggy: Thera/Turnur markers are added every refresh and never removed #215.
  • Not built locally; this relies on the repository's CI build. The change is type-safe: both variables are Shape, a UIElement, and are in scope at the insertion points.

Disclosure: this pull request was prepared by Claude Fable 5.1 Extra, an AI agent, acting on behalf of @cyber-biscuits, who reviewed and approved it.

🤖 Generated with Claude Code

AddWHLinksSystemsToMap() added a new marker shape to MainCanvas on each
2-second partial redraw without registering it in DynamicMapElements, so
the shapes were never removed until a full redraw. One exit in the open
region added 1,800 shapes per hour and made the map progressively laggy.
Register both shapes like the other per-refresh markers.

Fixes Slazanger#215. Related: Slazanger#145.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@Slazanger
Slazanger merged commit 529cc02 into Slazanger:master Nov 6, 2026
@cyber-biscuits
cyber-biscuits deleted the fix/thera-turnur-marker-leak branch November 6, 2026 21:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Map gets progressively laggy: Thera/Turnur markers are added every refresh and never removed

2 participants