Skip to content

Commit

Permalink
Let thread func have optional parameter
Browse files Browse the repository at this point in the history
Fixes #38042.
  • Loading branch information
Faymoon authored and akien-mga committed Jul 13, 2021
1 parent f2ad067 commit 78ead60
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion core/core_bind.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1729,10 +1729,11 @@ void _Thread::_start_func(void *ud) {
memdelete(tud);
Callable::CallError ce;
const Variant *arg[1] = { &t->userdata };
int argc = (int)(arg[0]->get_type() != Variant::NIL);

Thread::set_name(t->target_method);

t->ret = t->target_instance->call(t->target_method, arg, 1, ce);
t->ret = t->target_instance->call(t->target_method, arg, argc, ce);
if (ce.error != Callable::CallError::CALL_OK) {
String reason;
switch (ce.error) {
Expand Down

0 comments on commit 78ead60

Please sign in to comment.