Skip to content

Commit

Permalink
Merge pull request #85432 from RandomShaper/fix_gds_exit_crash_lower
Browse files Browse the repository at this point in the history
Fix GDScript thread-exit routine assuming thread-enter was called
  • Loading branch information
akien-mga committed Nov 27, 2023
2 parents a807d4b + cfa7e72 commit b3a0e07
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions modules/gdscript/gdscript.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2106,6 +2106,12 @@ void GDScriptLanguage::thread_enter() {
}

void GDScriptLanguage::thread_exit() {
// This thread may have been created before GDScript was up
// (which also means it can't have run any GDScript code at all).
if (!GDScript::func_ptrs_to_update_thread_local) {
return;
}

GDScript::_fixup_thread_function_bookkeeping();

bool destroy = false;
Expand Down

0 comments on commit b3a0e07

Please sign in to comment.