Fix the issue causing the Godot Android Editor to crash when returning from the launched and running game
The issue was caused because the running game pid was not set, and thus had a value of `0`. When trying to stop the running game, the `EditorRun::stop()` logic would kill the process with pid 0, which on Android corresponds to the running app's own process, thus causing the editor to crash. This issue did not happen on Godot 3 because pid with value of `0` are not considered valid.
This commit is contained in:
parent
18a2e7ff6e
commit
ec4d720850
9 changed files with 132 additions and 48 deletions
|
|
@ -739,9 +739,19 @@ 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) {
|
||||
godot_java->create_new_godot_instance(p_arguments);
|
||||
int instance_id = godot_java->create_new_godot_instance(p_arguments);
|
||||
if (r_child_id) {
|
||||
*r_child_id = instance_id;
|
||||
}
|
||||
return OK;
|
||||
}
|
||||
|
||||
Error OS_Android::kill(const ProcessID &p_pid) {
|
||||
if (godot_java->force_quit(nullptr, p_pid)) {
|
||||
return OK;
|
||||
}
|
||||
return OS_Unix::kill(p_pid);
|
||||
}
|
||||
|
||||
OS_Android::~OS_Android() {
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue