diff options
Diffstat (limited to 'modules/gdscript/register_types.cpp')
-rw-r--r-- | modules/gdscript/register_types.cpp | 8 |
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); } |