summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-05-25 22:13:49 +0200
committerGitHub <noreply@github.com>2020-05-25 22:13:49 +0200
commit072646f5ddb0ccc3f79ed717234eac656f8d2ea8 (patch)
tree69431e18cef2522e9d29145fad32ea175f502074
parent5b32bdc9f4622c8b3971da0d6b789a552ffe91e7 (diff)
parente7e736c03be30db520a061a342eba0e81e5d131d (diff)
Merge pull request #39047 from m4gr3d/fix_emit_signal
Fix parameters passing when emitting signal
-rw-r--r--platform/android/plugin/godot_plugin_jni.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/platform/android/plugin/godot_plugin_jni.cpp b/platform/android/plugin/godot_plugin_jni.cpp
index 557743fa73..053a4c078e 100644
--- a/platform/android/plugin/godot_plugin_jni.cpp
+++ b/platform/android/plugin/godot_plugin_jni.cpp
@@ -114,12 +114,13 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_plugin_GodotPlugin_nativeEmitS
String signal_name = jstring_to_string(j_signal_name, env);
int count = env->GetArrayLength(j_signal_params);
+ Variant variant_params[count];
const Variant *args[count];
for (int i = 0; i < count; i++) {
jobject j_param = env->GetObjectArrayElement(j_signal_params, i);
- Variant variant = _jobject_to_variant(env, j_param);
- args[i] = &variant;
+ variant_params[i] = _jobject_to_variant(env, j_param);
+ args[i] = &variant_params[i];
env->DeleteLocalRef(j_param);
};