Skip to content

fix(gui): prevent options menu crash due to null advanced display window#211

Draft
fbraz3 wants to merge 1 commit into
mainfrom
fix-issue-192
Draft

fix(gui): prevent options menu crash due to null advanced display window#211
fbraz3 wants to merge 1 commit into
mainfrom
fix-issue-192

Conversation

@fbraz3

@fbraz3 fbraz3 commented Jul 13, 2026

Copy link
Copy Markdown
Owner

Description

Fixes #192

Context

When entering the Options menu in the base game (Command & Conquer Generals), the game crashes with a segmentation fault.

Changes

  • Wrapped all calls to WinAdvancedDisplay->winHide() inside OptionsMenu.cpp (both in GeneralsMD and Generals) with an if (WinAdvancedDisplay) check.
  • The base game's layout does not define WinAdvancedDisplayOptions, which leads to the WinAdvancedDisplay pointer being nullptr and causing the segfault upon dereferencing.

Add null checks before winHide() is called on WinAdvancedDisplay in both GeneralsMD and Generals OptionsMenu.cpp. In the base game (Generals), WinAdvancedDisplayOptions is not defined in the wnd file, leading to WinAdvancedDisplay being nullptr and causing a segmentation fault when entering Options. Fixes #192
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.

Crash when trying to open Options

1 participant