You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-28 16:07:14 +00:00
Merge pull request #40852 from SkyLucilfer/FixLeak2
Refix GDScriptTranslationParser leak
This commit is contained in:
@@ -57,6 +57,8 @@ GDScriptCache *gdscript_cache = nullptr;
|
|||||||
#include "language_server/gdscript_language_server.h"
|
#include "language_server/gdscript_language_server.h"
|
||||||
#endif // !GDSCRIPT_NO_LSP
|
#endif // !GDSCRIPT_NO_LSP
|
||||||
|
|
||||||
|
Ref<GDScriptEditorTranslationParserPlugin> gdscript_translation_parser_plugin;
|
||||||
|
|
||||||
class EditorExportGDScript : public EditorExportPlugin {
|
class EditorExportGDScript : public EditorExportPlugin {
|
||||||
GDCLASS(EditorExportGDScript, EditorExportPlugin);
|
GDCLASS(EditorExportGDScript, EditorExportPlugin);
|
||||||
|
|
||||||
@@ -120,7 +122,6 @@ void register_gdscript_types() {
|
|||||||
#ifdef TOOLS_ENABLED
|
#ifdef TOOLS_ENABLED
|
||||||
EditorNode::add_init_callback(_editor_init);
|
EditorNode::add_init_callback(_editor_init);
|
||||||
|
|
||||||
Ref<GDScriptEditorTranslationParserPlugin> gdscript_translation_parser_plugin;
|
|
||||||
gdscript_translation_parser_plugin.instance();
|
gdscript_translation_parser_plugin.instance();
|
||||||
EditorTranslationParser::get_singleton()->add_parser(gdscript_translation_parser_plugin, EditorTranslationParser::STANDARD);
|
EditorTranslationParser::get_singleton()->add_parser(gdscript_translation_parser_plugin, EditorTranslationParser::STANDARD);
|
||||||
#endif // TOOLS_ENABLED
|
#endif // TOOLS_ENABLED
|
||||||
@@ -142,4 +143,9 @@ void unregister_gdscript_types() {
|
|||||||
|
|
||||||
ResourceSaver::remove_resource_format_saver(resource_saver_gd);
|
ResourceSaver::remove_resource_format_saver(resource_saver_gd);
|
||||||
resource_saver_gd.unref();
|
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
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user