summaryrefslogtreecommitdiffstats
path: root/modules/gdscript/register_types.cpp
diff options
context:
space:
mode:
authorGeorge Marques <george@gmarqu.es>2020-06-10 18:15:09 -0300
committerGeorge Marques <george@gmarqu.es>2020-07-20 11:38:39 -0300
commit7adb0d77cc5dbe0beaa05c9aac0f5c16f2b79775 (patch)
treefcccf467b84da2d5a4df3e20782edc253fccf03b /modules/gdscript/register_types.cpp
parent886732ac2b131de555494f292cbb7c5058b40cd9 (diff)
downloadredot-engine-7adb0d77cc5dbe0beaa05c9aac0f5c16f2b79775.tar.gz
Add GDScript cache singleton
Diffstat (limited to 'modules/gdscript/register_types.cpp')
-rw-r--r--modules/gdscript/register_types.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/modules/gdscript/register_types.cpp b/modules/gdscript/register_types.cpp
index 06367e3a31..962cdff442 100644
--- a/modules/gdscript/register_types.cpp
+++ b/modules/gdscript/register_types.cpp
@@ -35,11 +35,13 @@
#include "core/os/dir_access.h"
#include "core/os/file_access.h"
#include "gdscript.h"
+#include "gdscript_cache.h"
#include "gdscript_tokenizer.h"
GDScriptLanguage *script_language_gd = nullptr;
Ref<ResourceFormatLoaderGDScript> resource_loader_gd;
Ref<ResourceFormatSaverGDScript> resource_saver_gd;
+GDScriptCache *gdscript_cache = nullptr;
#ifdef TOOLS_ENABLED
@@ -121,6 +123,8 @@ void register_gdscript_types() {
resource_saver_gd.instance();
ResourceSaver::add_resource_format_saver(resource_saver_gd);
+ gdscript_cache = memnew(GDScriptCache);
+
#ifdef TOOLS_ENABLED
EditorNode::add_init_callback(_editor_init);
@@ -132,6 +136,10 @@ void register_gdscript_types() {
void unregister_gdscript_types() {
ScriptServer::unregister_language(script_language_gd);
+ if (gdscript_cache) {
+ memdelete(gdscript_cache);
+ }
+
if (script_language_gd) {
memdelete(script_language_gd);
}