diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-06-12 22:55:25 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-12 22:55:25 +0200 |
commit | ac73059b56b35e20258774755f9742d032f51f52 (patch) | |
tree | 957b4562f711730561f67b204cffc3b0ae2b72b7 /main | |
parent | edee79862894538ba29f0d2d4e90bdc970ba9e1c (diff) | |
parent | f64fea1b23df163485720c03054b3a17ae0c673a (diff) |
Merge pull request #49123 from aaronfranke/it-is-time
Add a Time singleton
Diffstat (limited to 'main')
-rw-r--r-- | main/main.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/main/main.cpp b/main/main.cpp index c2e3cc8d58..13a9986564 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -45,6 +45,7 @@ #include "core/io/resource_loader.h" #include "core/object/message_queue.h" #include "core/os/os.h" +#include "core/os/time.h" #include "core/register_core_types.h" #include "core/string/translation.h" #include "core/version.h" @@ -101,6 +102,7 @@ static InputMap *input_map = nullptr; static TranslationServer *translation_server = nullptr; static Performance *performance = nullptr; static PackedData *packed_data = nullptr; +static Time *time_singleton = nullptr; #ifdef MINIZIP_ENABLED static ZipArchive *zip_packed_data = nullptr; #endif @@ -532,6 +534,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph MAIN_PRINT("Main: Initialize Globals"); input_map = memnew(InputMap); + time_singleton = memnew(Time); globals = memnew(ProjectSettings); register_core_settings(); //here globals are present @@ -1402,6 +1405,9 @@ error: if (input_map) { memdelete(input_map); } + if (time_singleton) { + memdelete(time_singleton); + } if (translation_server) { memdelete(translation_server); } @@ -2667,6 +2673,9 @@ void Main::cleanup(bool p_force) { if (input_map) { memdelete(input_map); } + if (time_singleton) { + memdelete(time_singleton); + } if (translation_server) { memdelete(translation_server); } |