From 0e54ba0486e65af74f8b7729b09e42de5495d8ec Mon Sep 17 00:00:00 2001 From: SkyJJ Date: Mon, 27 Jul 2020 16:58:21 +0200 Subject: Fix EditorTranslationParser leak --- modules/gdscript/register_types.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'modules/gdscript') diff --git a/modules/gdscript/register_types.cpp b/modules/gdscript/register_types.cpp index 23c7f97b5a..5c1d2f6f1b 100644 --- a/modules/gdscript/register_types.cpp +++ b/modules/gdscript/register_types.cpp @@ -57,8 +57,6 @@ GDScriptCache *gdscript_cache = nullptr; #include "language_server/gdscript_language_server.h" #endif // !GDSCRIPT_NO_LSP -Ref gdscript_translation_parser_plugin; - class EditorExportGDScript : public EditorExportPlugin { GDCLASS(EditorExportGDScript, EditorExportPlugin); @@ -122,6 +120,7 @@ void register_gdscript_types() { #ifdef TOOLS_ENABLED EditorNode::add_init_callback(_editor_init); + Ref gdscript_translation_parser_plugin; gdscript_translation_parser_plugin.instance(); EditorTranslationParser::get_singleton()->add_parser(gdscript_translation_parser_plugin, EditorTranslationParser::STANDARD); #endif // TOOLS_ENABLED @@ -143,9 +142,4 @@ 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 } -- cgit v1.2.3