Skip to content

QtFred fix volumetric related crash on mission load#7610

Merged
JohnAFernandez merged 1 commit into
scp-fs2open:masterfrom
MjnMixael:qtfred-fix-volumetric-crash
Jul 15, 2026
Merged

QtFred fix volumetric related crash on mission load#7610
JohnAFernandez merged 1 commit into
scp-fs2open:masterfrom
MjnMixael:qtfred-fix-volumetric-crash

Conversation

@MjnMixael

Copy link
Copy Markdown
Contributor

FredRenderer freed its cached volumetric nebula hull model on missionLoaded, by which point clearMission() had already called model_free_all() and the incoming mission's ships had reused the slot. Since model_unload() reduces a model id to a slot index without checking the generation, this destroyed an unrelated ship's model and reset its Ship_info::model_num to -1, tripping "Invalid model number -1 requested" as soon as the mouse moved in the viewport.

Fixed by freeing the volume model at the top of clearMission(), while the model id is still valid, instead of after the new mission has loaded.

@MjnMixael MjnMixael added the qtfred A feature or issue related to qtFred. label Jul 15, 2026
@github-project-automation github-project-automation Bot moved this to Work In Progress (PRs) in qtFRED2 Jul 15, 2026
@github-project-automation github-project-automation Bot moved this from Work In Progress (PRs) to In Review (PRs) in qtFRED2 Jul 15, 2026
@JohnAFernandez
JohnAFernandez merged commit 446e894 into scp-fs2open:master Jul 15, 2026
18 checks passed
@github-project-automation github-project-automation Bot moved this from In Review (PRs) to Done in qtFRED2 Jul 15, 2026
@MjnMixael
MjnMixael deleted the qtfred-fix-volumetric-crash branch July 15, 2026 22:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

qtfred A feature or issue related to qtFred.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants