summaryrefslogtreecommitdiff
path: root/main/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'main/main.cpp')
-rw-r--r--main/main.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/main/main.cpp b/main/main.cpp
index db23a6c214..fd9054bf93 100644
--- a/main/main.cpp
+++ b/main/main.cpp
@@ -1230,6 +1230,7 @@ Error Main::setup2(Thread::ID p_main_tid_override) {
register_driver_types();
+ // This loads global classes, so it must happen before custom loaders and savers are registered
ScriptServer::init_languages();
MAIN_PRINT("Main: Load Translations");
@@ -1489,6 +1490,9 @@ bool Main::start() {
}
#endif
+ ResourceLoader::add_custom_loaders();
+ ResourceSaver::add_custom_savers();
+
if (!project_manager && !editor) { // game
if (game_path != "" || script != "") {
//autoload
@@ -1956,11 +1960,13 @@ void Main::force_redraw() {
* so that the engine closes cleanly without leaking memory or crashing.
* The order matters as some of those steps are linked with each other.
*/
-
void Main::cleanup() {
ERR_FAIL_COND(!_start_success);
+ ResourceLoader::remove_custom_loaders();
+ ResourceSaver::remove_custom_savers();
+
message_queue->flush();
memdelete(message_queue);