Skip to content

bugfix(gui): Only attach push button data to push button windows - #3480

Open
tintinhamans wants to merge 1 commit into
TheSuperHackers:mainfrom
tintinhamans:arctic/fix/pushbutton-data-guard
Open

tintinhamans wants to merge 1 commit into
TheSuperHackers:mainfrom
tintinhamans:arctic/fix/pushbutton-data-guard

Conversation

@tintinhamans

Copy link
Copy Markdown

GadgetButtonSetBorder, GadgetButtonDrawClock, GadgetButtonDrawInverseClock, GadgetButtonDrawOverlayImage and GadgetButtonSetData allocate a PushButtonData on whatever window they get. Only GadgetPushButtonSystem frees it on GWM_DESTROY, so on any other window it leaks.

Headless mode hits this every match: every window lookup resolves to the dummy window, whose system ignores GWM_DESTROY. The debug leak report of a headless replay grows by six blocks per match from this alone.

The setters now skip windows without GWS_PUSH_BUTTON, same check setControlCommand already makes.

@coderabbitai

coderabbitai Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 96ab3883-4ba1-4675-a718-4592d04c149f
📥 Commits

Reviewing files that changed from the base of the PR and between a112357 and 90622b0.

📒 Files selected for processing (1)
  • Core/GameEngine/Source/GameClient/GUI/Gadget/GadgetPushButton.cpp

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 0 remain after this review.

Walkthrough

Push-button operations now check that a window is non-null and has the GWS_PUSH_BUTTON style before changing button data or drawing button elements.

Changes

Push-button window guards

Layer / File(s) Summary
Style check and operation guards
Core/GameEngine/Source/GameClient/GUI/Gadget/GadgetPushButton.cpp
A new helper checks for a non-null window with the GWS_PUSH_BUTTON style. GadgetButtonSetBorder, GadgetButtonDrawClock, GadgetButtonDrawInverseClock, GadgetButtonDrawOverlayImage, and GadgetButtonSetData now return when this check fails.

Priority: ➖ Normal

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Bug fix

Suggested reviewers: skyaero42

Merge Risk: ⚪ Minimal · up to 90622

No verified user-facing regression remains. The external ControlBar layout styles are unknown, but available code evidence does not establish that the new guards suppress required updates.

Pre-merge checks · Passed 4
Passed Passed checks (4 passed)
Check name Status Explanation
Title check Passed The title clearly identifies the bug fix and matches the main change: limiting push button data to push button windows.
Description check Passed The description explains the memory leak, affected functions, headless replay impact, and implemented fix. It is directly related to the changeset.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable defects were found.

Summary

Restricts five button setters to windows with GWS_PUSH_BUTTON.

  • Push-button helpers only attach their data to push-button windows.

Reviews (2) · Last reviewed commit: "bugfix(gui): Only attach push button dat..." · Reviewed by Greptile

@tintinhamans tintinhamans added Bug Something is not working right, typically is user facing Gen Relates to Generals ZH Relates to Zero Hour Memory Is memory related labels Oct 11, 2026
Comment thread Core/GameEngine/Source/GameClient/GUI/Gadget/GadgetPushButton.cpp Outdated
@tintinhamans
tintinhamans force-pushed the arctic/fix/pushbutton-data-guard branch from a112357 to 90622b0 Compare October 13, 2026 08:02
@tintinhamans tintinhamans added the GUI For graphical user interface label Oct 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something is not working right, typically is user facing Gen Relates to Generals GUI For graphical user interface Memory Is memory related ZH Relates to Zero Hour

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants