summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--platform/android/java/lib/src/org/godotengine/godot/Godot.kt2
-rw-r--r--platform/android/java/lib/src/org/godotengine/godot/GodotFragment.java2
-rw-r--r--platform/android/java/lib/src/org/godotengine/godot/GodotHost.java2
-rw-r--r--platform/android/os_android.cpp3
4 files changed, 6 insertions, 3 deletions
diff --git a/platform/android/java/lib/src/org/godotengine/godot/Godot.kt b/platform/android/java/lib/src/org/godotengine/godot/Godot.kt
index 3ad8e6bc9e..f82b44c544 100644
--- a/platform/android/java/lib/src/org/godotengine/godot/Godot.kt
+++ b/platform/android/java/lib/src/org/godotengine/godot/Godot.kt
@@ -1123,7 +1123,7 @@ class Godot(private val context: Context) {
@Keep
private fun createNewGodotInstance(args: Array<String>): Int {
- return primaryHost?.onNewGodotInstanceRequested(args) ?: 0
+ return primaryHost?.onNewGodotInstanceRequested(args) ?: -1
}
@Keep
diff --git a/platform/android/java/lib/src/org/godotengine/godot/GodotFragment.java b/platform/android/java/lib/src/org/godotengine/godot/GodotFragment.java
index d60595c0bb..7cfe3ef3e8 100644
--- a/platform/android/java/lib/src/org/godotengine/godot/GodotFragment.java
+++ b/platform/android/java/lib/src/org/godotengine/godot/GodotFragment.java
@@ -474,7 +474,7 @@ public class GodotFragment extends Fragment implements IDownloaderClient, GodotH
if (parentHost != null) {
return parentHost.onNewGodotInstanceRequested(args);
}
- return 0;
+ return -1;
}
@Override
diff --git a/platform/android/java/lib/src/org/godotengine/godot/GodotHost.java b/platform/android/java/lib/src/org/godotengine/godot/GodotHost.java
index 344b73f799..60d1f01b21 100644
--- a/platform/android/java/lib/src/org/godotengine/godot/GodotHost.java
+++ b/platform/android/java/lib/src/org/godotengine/godot/GodotHost.java
@@ -92,7 +92,7 @@ public interface GodotHost {
* @return the id of the new instance. See {@code onGodotForceQuit}
*/
default int onNewGodotInstanceRequested(String[] args) {
- return 0;
+ return -1;
}
/**
diff --git a/platform/android/os_android.cpp b/platform/android/os_android.cpp
index 7b0d3a29e9..06f5df4871 100644
--- a/platform/android/os_android.cpp
+++ b/platform/android/os_android.cpp
@@ -863,6 +863,9 @@ Error OS_Android::create_process(const String &p_path, const List<String> &p_arg
Error OS_Android::create_instance(const List<String> &p_arguments, ProcessID *r_child_id) {
int instance_id = godot_java->create_new_godot_instance(p_arguments);
+ if (instance_id == -1) {
+ return FAILED;
+ }
if (r_child_id) {
*r_child_id = instance_id;
}