summaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2024-06-04 10:10:21 +0200
committerRémi Verschelde <rverschelde@gmail.com>2024-06-04 10:10:21 +0200
commit4bf961e0070fcc45114c1d1334d9a951d6a2ae41 (patch)
treea4bd39161e0c1f1c4d121b3c246a65733ac3543a /main
parent241d45d063060cfddf77093d2cf0aad087118e35 (diff)
parentd1ab5d371785635bfe401857370ac21dd0439dee (diff)
downloadredot-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.cpp19
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();