Skip to content

Commit de80c25

Browse files
authored
Ensure that SEXP shudown is before script shutdown (#4503)
* Ensure that SEXP shudown is before script shutdown * Move before scpui destroy call
1 parent d703fca commit de80c25

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

freespace2/freespace.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6683,11 +6683,14 @@ void game_shutdown(void)
66836683
gr_clear();
66846684
gr_flip();
66856685
}
6686-
6686+
6687+
// Free SEXP resources
6688+
sexp_shutdown();
6689+
66876690
// Free the scripting resources of the new UI first
66886691
scpui::shutdown_scripting();
66896692

6690-
// Everything after this should be done without scripting so we can free those resources here
6693+
// Everything after this should be done without scripting so we can free those resources here. By this point, all things that hold Lua References must be destroyed (such as Lua SEXPs)
66916694
Script_system.Clear();
66926695

66936696
// Deinitialize the new UI system, needs to be done after scripting shutdown to make sure the resources were
@@ -6729,8 +6732,6 @@ void game_shutdown(void)
67296732

67306733
scoring_close();
67316734

6732-
// Free SEXP resources
6733-
sexp_shutdown();
67346735

67356736
stars_close(); // clean out anything used by stars code
67366737

0 commit comments

Comments
 (0)