Fix Callable::bind usage in connections_dialog.h and packed_scene.cpp
* Callable::bind takes an array of pointers to Variant * Fixes #57057
This commit is contained in:
parent
c5efda5f4e
commit
619d9d143b
@ -93,8 +93,11 @@ public:
|
|||||||
if (unbinds > 0) {
|
if (unbinds > 0) {
|
||||||
return Callable(target, method).unbind(unbinds);
|
return Callable(target, method).unbind(unbinds);
|
||||||
} else if (!binds.is_empty()) {
|
} else if (!binds.is_empty()) {
|
||||||
const Variant *args = binds.ptr();
|
const Variant **argptrs = (const Variant **)alloca(sizeof(Variant *) * binds.size());
|
||||||
return Callable(target, method).bind(&args, binds.size());
|
for (int i = 0; i < binds.size(); i++) {
|
||||||
|
argptrs[i] = &binds[i];
|
||||||
|
}
|
||||||
|
return Callable(target, method).bind(argptrs, binds.size());
|
||||||
} else {
|
} else {
|
||||||
return Callable(target, method);
|
return Callable(target, method);
|
||||||
}
|
}
|
||||||
|
@ -362,8 +362,11 @@ Node *SceneState::instantiate(GenEditState p_edit_state) const {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const Variant *args = binds.ptr();
|
const Variant **argptrs = (const Variant **)alloca(sizeof(Variant *) * binds.size());
|
||||||
callable = callable.bind(&args, binds.size());
|
for (int j = 0; j < binds.size(); j++) {
|
||||||
|
argptrs[j] = &binds[j];
|
||||||
|
}
|
||||||
|
callable = callable.bind(argptrs, binds.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
cfrom->connect(snames[c.signal], callable, varray(), CONNECT_PERSIST | c.flags);
|
cfrom->connect(snames[c.signal], callable, varray(), CONNECT_PERSIST | c.flags);
|
||||||
|
Loading…
Reference in New Issue
Block a user