You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
• Remove every modal-stack entry referencing a window when destruction begins.
• Preserve hidden-window behavior by limiting modal cleanup to destruction.
• Apply identical lifecycle handling to Generals and Zero Hour.
The dedicated destruction-only helper is the best fit: it removes buried and duplicate references immediately while preserving winUnsetModal's top-of-stack contract and hidden-window behavior. Reusing or broadening winUnsetModal would change its public semantics, while cleanup during deferred deletion would leave stale references alive longer.
GameWindowManager.cppPurge destroyed Generals windows from the full modal stack+21/-5
Purge destroyed Generals windows from the full modal stack
• Calls modal cleanup when destruction begins instead of only unsetting the current modal head. The pointer-to-pointer traversal removes all matching entries, including buried or duplicate references, before deferred deletion.
GameWindowManager.cppPurge destroyed Zero Hour windows from the full modal stack+21/-5
Purge destroyed Zero Hour windows from the full modal stack
• Mirrors the Generals fix by removing every modal entry for a window as soon as destruction begins. This prevents deferred deletion from leaving dangling modal pointers.
This PR prevents destroyed GUI windows from remaining as dangling entries in the modal stack in both Generals variants.
Adds a helper that traverses the complete modal stack and removes every entry associated with a destroyed window.
Invokes the cleanup when a window enters the deferred destruction path.
Preserves the existing top-only modal behavior for hidden windows.
Confidence Score: 5/5
The PR appears safe to merge with no actionable defects identified.
The destruction path now removes all modal nodes before deferred window deletion, while every destroy-list insertion passes through that cleanup and the unlink loop safely handles buried and duplicate entries.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A destroyed window could stay buried in the modal stack. The game could later use that dead pointer and crash.
This removes destroyed windows from the whole stack. Hidden windows keep the old behavior so they can still be shown again.
Applied to Generals and Zero Hour.
Closes #3223