Merge pull request #39081 from m4gr3d/fix_emit_signal_3_2
[3.2] Fix parameters passing when emitting signal
This commit is contained in:
commit
9aeb9ea826
|
@ -119,13 +119,15 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_plugin_GodotPlugin_nativeEmitS
|
||||||
String signal_name = jstring_to_string(j_signal_name, env);
|
String signal_name = jstring_to_string(j_signal_name, env);
|
||||||
|
|
||||||
int count = env->GetArrayLength(j_signal_params);
|
int count = env->GetArrayLength(j_signal_params);
|
||||||
const Variant *args[count];
|
ERR_FAIL_COND_MSG(count > VARIANT_ARG_MAX, "Maximum argument count exceeded!");
|
||||||
|
|
||||||
|
Variant variant_params[VARIANT_ARG_MAX];
|
||||||
|
const Variant *args[VARIANT_ARG_MAX];
|
||||||
|
|
||||||
for (int i = 0; i < count; i++) {
|
for (int i = 0; i < count; i++) {
|
||||||
|
|
||||||
jobject j_param = env->GetObjectArrayElement(j_signal_params, i);
|
jobject j_param = env->GetObjectArrayElement(j_signal_params, i);
|
||||||
Variant variant = _jobject_to_variant(env, j_param);
|
variant_params[i] = _jobject_to_variant(env, j_param);
|
||||||
args[i] = &variant;
|
args[i] = &variant_params[i];
|
||||||
env->DeleteLocalRef(j_param);
|
env->DeleteLocalRef(j_param);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue