Merge pull request #92733 from raulsntos/core/memdelete-engine-later-but-not-that-late

Release Engine before unregistering core types
This commit is contained in:
Rémi Verschelde 2024-06-04 10:10:21 +02:00
commit 4bf961e007
No known key found for this signature in database
GPG Key ID: C3336907360768E1

View File

@ -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();