diff options
| author | Wilson E. Alvarez | 2017-08-23 20:54:02 -0400 |
|---|---|---|
| committer | Rémi Verschelde | 2017-08-27 13:02:15 +0200 |
| commit | 48b85347c614cbcb45f9715ccd290616f86ba6e5 (patch) | |
| tree | 327fe65b90a4d1ae304c95fa2613785773d4d9ea | |
| parent | 3b9ee55c326835c909bb9b383fb7e3ab8eadad22 (diff) | |
| download | godot-48b85347c614cbcb45f9715ccd290616f86ba6e5.tar.gz godot-48b85347c614cbcb45f9715ccd290616f86ba6e5.tar.zst godot-48b85347c614cbcb45f9715ccd290616f86ba6e5.zip | |
| -rw-r--r-- | platform/windows/godot_win.cpp | 7 | ||||
| -rw-r--r-- | platform/x11/godot_x11.cpp | 4 |
2 files changed, 9 insertions, 2 deletions
diff --git a/platform/windows/godot_win.cpp b/platform/windows/godot_win.cpp index df2d96e51..6f1fb0470 100644 --- a/platform/windows/godot_win.cpp +++ b/platform/windows/godot_win.cpp @@ -136,8 +136,13 @@ int widechar_main(int argc, wchar_t **argv) { Error err = Main::setup(argv_utf8[0], argc - 1, &argv_utf8[1]); - if (err != OK) + if (err != OK) { + for (int i = 0; i < argc; ++i) { + delete[] argv_utf8[i]; + } + delete[] argv_utf8; return 255; + } if (Main::start()) os.run(); diff --git a/platform/x11/godot_x11.cpp b/platform/x11/godot_x11.cpp index b293b1beb..c11c8ee2e 100644 --- a/platform/x11/godot_x11.cpp +++ b/platform/x11/godot_x11.cpp @@ -42,8 +42,10 @@ int main(int argc, char *argv[]) { getcwd(cwd, PATH_MAX); Error err = Main::setup(argv[0], argc - 1, &argv[1]); - if (err != OK) + if (err != OK) { + free(cwd); return 255; + } if (Main::start()) os.run(); // it is actually the OS that decides how to run |
