summaryrefslogtreecommitdiff
path: root/main/main.cpp
diff options
context:
space:
mode:
authorAaron Franke <arnfranke@yahoo.com>2021-05-24 07:54:05 -0400
committerAaron Franke <arnfranke@yahoo.com>2021-06-11 09:32:39 -0400
commitf64fea1b23df163485720c03054b3a17ae0c673a (patch)
treea54fba35de18018c4d09f2f8b43ed972cebe858b /main/main.cpp
parente82a1113abbb72504e9b12a131738bedb40d3a28 (diff)
Add Time singleton
Diffstat (limited to 'main/main.cpp')
-rw-r--r--main/main.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/main/main.cpp b/main/main.cpp
index d67761db55..c4c6b464f5 100644
--- a/main/main.cpp
+++ b/main/main.cpp
@@ -45,6 +45,7 @@
#include "core/object/message_queue.h"
#include "core/os/dir_access.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);
}