1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-19 14:31:59 +00:00

Fix 'save & restart' logic for the Android Editor

This commit is contained in:
Fredia Huya-Kouadio
2022-11-15 08:46:45 -08:00
parent 1ad9992ab7
commit 5aab84befb
3 changed files with 57 additions and 27 deletions

View File

@@ -2488,6 +2488,9 @@ void Main::cleanup(bool p_force) {
OS::get_singleton()->delete_main_loop();
// Storing it for use when restarting as it's being cleared right below.
const String execpath = OS::get_singleton()->get_executable_path();
OS::get_singleton()->_cmdline.clear();
OS::get_singleton()->_execpath = "";
OS::get_singleton()->_local_clipboard = "";
@@ -2558,10 +2561,9 @@ void Main::cleanup(bool p_force) {
if (OS::get_singleton()->is_restart_on_exit_set()) {
//attempt to restart with arguments
String exec = OS::get_singleton()->get_executable_path();
List<String> args = OS::get_singleton()->get_restart_on_exit_arguments();
OS::ProcessID pid = 0;
OS::get_singleton()->execute(exec, args, false, &pid);
OS::get_singleton()->execute(execpath, args, false, &pid);
OS::get_singleton()->set_restart_on_exit(false, List<String>()); //clear list (uses memory)
}