Merge pull request #85432 from RandomShaper/fix_gds_exit_crash_lower

Fix GDScript thread-exit routine assuming thread-enter was called
This commit is contained in:
Rémi Verschelde 2023-11-27 16:01:55 +01:00
commit b3a0e077eb
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

@ -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;