Skip to content

Commit 4c02239

Browse files
committed
Merge pull request #105180 from bruvzg/thread_crash
Fix Thread crash when using invalid callback signature. And invalid message formatting.
2 parents 604e1c1 + 41a87f0 commit 4c02239

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

core/core_bind.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1339,6 +1339,7 @@ void Thread::_start_func(void *ud) {
13391339
// When the call returns, we will reference the thread again if possible.
13401340
ObjectID th_instance_id = t->get_instance_id();
13411341
Callable target_callable = t->target_callable;
1342+
String id = t->get_id();
13421343
t = Ref<Thread>();
13431344

13441345
Callable::CallError ce;
@@ -1356,7 +1357,7 @@ void Thread::_start_func(void *ud) {
13561357
}
13571358

13581359
if (ce.error != Callable::CallError::CALL_OK) {
1359-
ERR_FAIL_MSG(vformat("Could not call function '%s' to start thread %d: %s.", func_name, t->get_id(), Variant::get_callable_error_text(t->target_callable, nullptr, 0, ce)));
1360+
ERR_FAIL_MSG(vformat("Could not call function '%s' to start thread %s: %s.", func_name, id, Variant::get_callable_error_text(target_callable, nullptr, 0, ce)));
13601361
}
13611362
}
13621363

0 commit comments

Comments
 (0)