diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2024-06-04 10:10:21 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2024-06-04 10:10:21 +0200 |
commit | 4bf961e0070fcc45114c1d1334d9a951d6a2ae41 (patch) | |
tree | a4bd39161e0c1f1c4d121b3c246a65733ac3543a /main | |
parent | 241d45d063060cfddf77093d2cf0aad087118e35 (diff) | |
parent | d1ab5d371785635bfe401857370ac21dd0439dee (diff) | |
download | redot-engine-4bf961e0070fcc45114c1d1334d9a951d6a2ae41.tar.gz |
Merge pull request #92733 from raulsntos/core/memdelete-engine-later-but-not-that-late
Release Engine before unregistering core types
Diffstat (limited to 'main')
-rw-r--r-- | main/main.cpp | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/main/main.cpp b/main/main.cpp index 1cdfad7836..44201522af 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -838,13 +838,15 @@ void Main::test_cleanup() { if (globals) { memdelete(globals); } - if (engine) { - memdelete(engine); - } unregister_core_driver_types(); unregister_core_extensions(); uninitialize_modules(MODULE_INITIALIZATION_LEVEL_CORE); + + if (engine) { + memdelete(engine); + } + unregister_core_types(); OS::get_singleton()->finalize_core(); @@ -2496,15 +2498,17 @@ error: if (globals) { memdelete(globals); } - if (engine) { - memdelete(engine); - } if (packed_data) { memdelete(packed_data); } unregister_core_driver_types(); unregister_core_extensions(); + + if (engine) { + memdelete(engine); + } + unregister_core_types(); OS::get_singleton()->_cmdline.clear(); @@ -4365,12 +4369,13 @@ void Main::cleanup(bool p_force) { unregister_core_driver_types(); unregister_core_extensions(); uninitialize_modules(MODULE_INITIALIZATION_LEVEL_CORE); - unregister_core_types(); if (engine) { memdelete(engine); } + unregister_core_types(); + OS::get_singleton()->benchmark_end_measure("Shutdown", "Total"); OS::get_singleton()->benchmark_dump(); |