Skip to content

null out editor-dialog globals on DestroyWindow#7512

Open
Goober5000 wants to merge 1 commit into
scp-fs2open:masterfrom
Goober5000:cleanup/fred_destroy_window
Open

null out editor-dialog globals on DestroyWindow#7512
Goober5000 wants to merge 1 commit into
scp-fs2open:masterfrom
Goober5000:cleanup/fred_destroy_window

Conversation

@Goober5000

Copy link
Copy Markdown
Contributor

Several dialogs already null their global at the top of DestroyWindow, but a few do not: briefing, debriefing, event, background, message, cutscene, goal, and Fred_view_wnd. OnClose nulls in those five cover the user-initiated close path, but any teardown that bypasses OnClose leaves a dangling pointer that could be dereferenced.

Several dialogs already null their global at the top of DestroyWindow, but a few do not: briefing, debriefing, event, background, message, cutscene, goal, and Fred_view_wnd.  OnClose nulls in those five cover the user-initiated close path, but any teardown that bypasses OnClose leaves a dangling pointer that could be dereferenced.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@Goober5000 Goober5000 added cleanup A modification or rewrite of code to make it more understandable or easier to maintain. fred A feature or issue related to the FReespace EDitor (FRED) labels Jun 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cleanup A modification or rewrite of code to make it more understandable or easier to maintain. fred A feature or issue related to the FReespace EDitor (FRED)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants