diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-07-29 23:58:47 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-29 23:58:47 +0200 |
commit | dd9b89580fe56cda841801946ee667f07bcf52bb (patch) | |
tree | 858a352fb529cb9d5763a801debdaa093d9d262f /modules | |
parent | b27bdcb51e91492b5afaa5dfc81615517cadb3b5 (diff) | |
parent | 9cd1ef573cda06a279eff7d25a5a01c3d72349d6 (diff) |
Merge pull request #40852 from SkyLucilfer/FixLeak2
Refix GDScriptTranslationParser leak
Diffstat (limited to 'modules')
-rw-r--r-- | modules/gdscript/register_types.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/modules/gdscript/register_types.cpp b/modules/gdscript/register_types.cpp index 5c1d2f6f1b..23c7f97b5a 100644 --- a/modules/gdscript/register_types.cpp +++ b/modules/gdscript/register_types.cpp @@ -57,6 +57,8 @@ GDScriptCache *gdscript_cache = nullptr; #include "language_server/gdscript_language_server.h" #endif // !GDSCRIPT_NO_LSP +Ref<GDScriptEditorTranslationParserPlugin> gdscript_translation_parser_plugin; + class EditorExportGDScript : public EditorExportPlugin { GDCLASS(EditorExportGDScript, EditorExportPlugin); @@ -120,7 +122,6 @@ void register_gdscript_types() { #ifdef TOOLS_ENABLED EditorNode::add_init_callback(_editor_init); - Ref<GDScriptEditorTranslationParserPlugin> gdscript_translation_parser_plugin; gdscript_translation_parser_plugin.instance(); EditorTranslationParser::get_singleton()->add_parser(gdscript_translation_parser_plugin, EditorTranslationParser::STANDARD); #endif // TOOLS_ENABLED @@ -142,4 +143,9 @@ void unregister_gdscript_types() { ResourceSaver::remove_resource_format_saver(resource_saver_gd); resource_saver_gd.unref(); + +#ifdef TOOLS_ENABLED + EditorTranslationParser::get_singleton()->remove_parser(gdscript_translation_parser_plugin, EditorTranslationParser::STANDARD); + gdscript_translation_parser_plugin.unref(); +#endif // TOOLS_ENABLED } |