Android: OS.create_instance()
should return -1
on failure
This commit is contained in:
parent
d09d82d433
commit
38e0532ffa
@ -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
|
||||
|
@ -474,7 +474,7 @@ public class GodotFragment extends Fragment implements IDownloaderClient, GodotH
|
||||
if (parentHost != null) {
|
||||
return parentHost.onNewGodotInstanceRequested(args);
|
||||
}
|
||||
return 0;
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user