diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-07-01 13:46:50 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-01 13:46:50 +0200 |
commit | 56e50f91d384096d296d3ac81e791135db33c3ce (patch) | |
tree | 55ded281755d2f87b553b4d952c32cbf2e4ef0bb /core | |
parent | 03765b298554dcbad40f45372d6c59b358d4a845 (diff) | |
parent | 7d5c9432020610325483d8e529817e5d0f5cafd3 (diff) |
Merge pull request #62589 from KoBeWi/custom_threads
Diffstat (limited to 'core')
-rw-r--r-- | core/core_bind.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/core/core_bind.cpp b/core/core_bind.cpp index b5f4a1c0f6..24b27d2692 100644 --- a/core/core_bind.cpp +++ b/core/core_bind.cpp @@ -1840,13 +1840,14 @@ void Thread::_start_func(void *ud) { ERR_FAIL_MSG(vformat("Could not call function '%s' on previously freed instance to start thread %s.", t->target_callable.get_method(), t->get_id())); } - ::Thread::set_name(t->target_callable.get_method()); + String func_name = t->target_callable.is_custom() ? t->target_callable.get_custom()->get_as_text() : String(t->target_callable.get_method()); + ::Thread::set_name(func_name); Callable::CallError ce; t->target_callable.call(nullptr, 0, t->ret, ce); if (ce.error != Callable::CallError::CALL_OK) { t->running.clear(); - ERR_FAIL_MSG("Could not call function '" + t->target_callable.get_method().operator String() + "' to start thread " + t->get_id() + ": " + Variant::get_callable_error_text(t->target_callable, nullptr, 0, ce) + "."); + ERR_FAIL_MSG("Could not call function '" + func_name + "' to start thread " + t->get_id() + ": " + Variant::get_callable_error_text(t->target_callable, nullptr, 0, ce) + "."); } t->running.clear(); |