summaryrefslogtreecommitdiffstats
path: root/main/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'main/main.cpp')
-rw-r--r--main/main.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/main/main.cpp b/main/main.cpp
index 66706be745..65f637d778 100644
--- a/main/main.cpp
+++ b/main/main.cpp
@@ -2196,11 +2196,11 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
if (globals->has_setting("display/window/size/window_width_override") &&
globals->has_setting("display/window/size/window_height_override")) {
- int desired_width = globals->get("display/window/size/window_width_override");
+ int desired_width = GLOBAL_GET("display/window/size/window_width_override");
if (desired_width > 0) {
window_size.width = desired_width;
}
- int desired_height = globals->get("display/window/size/window_height_override");
+ int desired_height = GLOBAL_GET("display/window/size/window_height_override");
if (desired_height > 0) {
window_size.height = desired_height;
}
@@ -4295,9 +4295,6 @@ void Main::cleanup(bool p_force) {
if (globals) {
memdelete(globals);
}
- if (engine) {
- memdelete(engine);
- }
if (OS::get_singleton()->is_restart_on_exit_set()) {
//attempt to restart with arguments
@@ -4315,6 +4312,10 @@ void Main::cleanup(bool p_force) {
uninitialize_modules(MODULE_INITIALIZATION_LEVEL_CORE);
unregister_core_types();
+ if (engine) {
+ memdelete(engine);
+ }
+
OS::get_singleton()->benchmark_end_measure("Shutdown", "Total");
OS::get_singleton()->benchmark_dump();