summaryrefslogtreecommitdiffstats
path: root/modules/gdscript/gdscript_lambda_callable.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2023-11-12 12:14:42 +0100
committerRémi Verschelde <rverschelde@gmail.com>2023-11-12 12:14:42 +0100
commitbc807766182ee52902464faa4cbf34756b0c868b (patch)
tree0d9d7ef5750c2d2ef2a52cec0896491a46721e4b /modules/gdscript/gdscript_lambda_callable.cpp
parent10e820a783e4e8d379e8f55a54c1dc0bc3c5a203 (diff)
parent271511726b02848783904429c8dde857f6266429 (diff)
downloadredot-engine-bc807766182ee52902464faa4cbf34756b0c868b.tar.gz
Merge pull request #84659 from RandomShaper/fix_lambda_cross_thread
Fix lambda cross-thread dynamics
Diffstat (limited to 'modules/gdscript/gdscript_lambda_callable.cpp')
-rw-r--r--modules/gdscript/gdscript_lambda_callable.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/modules/gdscript/gdscript_lambda_callable.cpp b/modules/gdscript/gdscript_lambda_callable.cpp
index 547f5607d3..339d1ac08e 100644
--- a/modules/gdscript/gdscript_lambda_callable.cpp
+++ b/modules/gdscript/gdscript_lambda_callable.cpp
@@ -296,5 +296,7 @@ GDScriptLambdaSelfCallable::GDScriptLambdaSelfCallable(Object *p_self, GDScriptF
}
GDScriptLambdaSelfCallable::~GDScriptLambdaSelfCallable() {
- GDScript::_remove_func_ptr_to_update(updatable_func_ptr_element);
+ if (updatable_func_ptr_element) {
+ GDScript::_remove_func_ptr_to_update(updatable_func_ptr_element);
+ }
}