diff options
author | Fredia Huya-Kouadio <fhuya@meta.com> | 2023-01-26 02:55:47 -0800 |
---|---|---|
committer | Fredia Huya-Kouadio <fhuya@meta.com> | 2023-01-26 02:59:39 -0800 |
commit | ec4d720850091c7c2d3715031318bfcdbb391f62 (patch) | |
tree | f446a147685599212aaff22aff6c84549ab1996e /editor | |
parent | 18a2e7ff6ebf0a477138c12c3efa63c15270a2ee (diff) |
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.
Diffstat (limited to 'editor')
-rw-r--r-- | editor/editor_run.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/editor/editor_run.cpp b/editor/editor_run.cpp index 4bcd91376a..d3cceee1a3 100644 --- a/editor/editor_run.cpp +++ b/editor/editor_run.cpp @@ -272,7 +272,9 @@ Error EditorRun::run(const String &p_scene, const String &p_write_movie) { OS::ProcessID pid = 0; Error err = OS::get_singleton()->create_instance(args, &pid); ERR_FAIL_COND_V(err, err); - pids.push_back(pid); + if (pid != 0) { + pids.push_back(pid); + } } status = STATUS_PLAY; |