Skip to content

Fix: Prevent crashes during drawable iteration when drawables are destroyed#369

Open
seer-by-sentry[bot] wants to merge 1 commit intomainfrom
seer/fix/safe-drawable-iteration
Open

Fix: Prevent crashes during drawable iteration when drawables are destroyed#369
seer-by-sentry[bot] wants to merge 1 commit intomainfrom
seer/fix/safe-drawable-iteration

Conversation

@seer-by-sentry
Copy link

@seer-by-sentry seer-by-sentry bot commented Mar 2, 2026

Fixes CLIENT-3VG. The issue was that: Drawable removed from list during iteration, causing use-after-free when accessing its template.

  • Modified GameClient::iterateDrawablesInRegion to prevent potential crashes.
  • The original implementation could lead to dangling pointers and crashes if a drawable was destroyed indirectly by the userFunc callback during iteration.
  • The fix now first collects the DrawableIDs of all relevant drawables within the region.
  • It then iterates through these collected IDs, retrieving the drawable pointer using findDrawableByID() and checking for null before invoking the userFunc.
  • This ensures that callbacks are only made on valid, existing drawables, even if others are destroyed during the process.

This fix was generated by Seer in Sentry, triggered automatically. 👁️ Run ID: 10967001

Not quite right? Click here to continue debugging with Seer.

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.

0 participants