diff options
author | C.Even <c.even@live.cn> | 2022-03-29 11:48:49 +0800 |
---|---|---|
committer | C.Even <c.even@live.cn> | 2022-03-29 12:15:36 +0800 |
commit | 619d9d143baff60827249a5592b2117675ae88f1 (patch) | |
tree | adbb6ab467c9340c75d93c474f406bc7b64792e7 /scene/resources/packed_scene.cpp | |
parent | c5efda5f4ef983c74068ab39f2eb47292cd7b4e9 (diff) | |
download | redot-engine-619d9d143baff60827249a5592b2117675ae88f1.tar.gz |
Fix Callable::bind usage in connections_dialog.h and packed_scene.cpp
* Callable::bind takes an array of pointers to Variant
* Fixes #57057
Diffstat (limited to 'scene/resources/packed_scene.cpp')
-rw-r--r-- | scene/resources/packed_scene.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/scene/resources/packed_scene.cpp b/scene/resources/packed_scene.cpp index a3e356feaf..b1c2702a1e 100644 --- a/scene/resources/packed_scene.cpp +++ b/scene/resources/packed_scene.cpp @@ -362,8 +362,11 @@ Node *SceneState::instantiate(GenEditState p_edit_state) const { } } - const Variant *args = binds.ptr(); - callable = callable.bind(&args, binds.size()); + const Variant **argptrs = (const Variant **)alloca(sizeof(Variant *) * 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); |