You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-06 12:20:30 +00:00
Let thread func have optional parameter
Fixes #38042.
(cherry picked from commit 78ead60372)
This commit is contained in:
@@ -2577,10 +2577,11 @@ void _Thread::_start_func(void *ud) {
|
|||||||
memdelete(tud);
|
memdelete(tud);
|
||||||
Variant::CallError ce;
|
Variant::CallError ce;
|
||||||
const Variant *arg[1] = { &t->userdata };
|
const Variant *arg[1] = { &t->userdata };
|
||||||
|
int argc = (int)(arg[0]->get_type() != Variant::NIL);
|
||||||
|
|
||||||
Thread::set_name(t->target_method);
|
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 != Variant::CallError::CALL_OK) {
|
if (ce.error != Variant::CallError::CALL_OK) {
|
||||||
String reason;
|
String reason;
|
||||||
switch (ce.error) {
|
switch (ce.error) {
|
||||||
|
|||||||
Reference in New Issue
Block a user