diff options
| author | Rémi Verschelde <rverschelde@gmail.com> | 2020-07-28 00:31:46 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-07-28 00:31:46 +0200 |
| commit | 4e825539e590c6ce06e54fbb05571efce7fb181c (patch) | |
| tree | 662a6a08ed32be814d315aaa7852ae4595aa8e00 /editor | |
| parent | 5f28ab6566a4e12b802f06584ead65e640c295f1 (diff) | |
| parent | 0e54ba0486e65af74f8b7729b09e42de5495d8ec (diff) | |
| download | redot-engine-4e825539e590c6ce06e54fbb05571efce7fb181c.tar.gz | |
Merge pull request #40762 from SkyLucilfer/PackedSceneLeak
Fix EditorTranslationParser leak
Diffstat (limited to 'editor')
| -rw-r--r-- | editor/editor_node.cpp | 1 | ||||
| -rw-r--r-- | editor/editor_translation_parser.cpp | 5 | ||||
| -rw-r--r-- | editor/editor_translation_parser.h | 1 |
3 files changed, 7 insertions, 0 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 7eb5b3094d..ce131e6a05 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -6799,6 +6799,7 @@ EditorNode::EditorNode() { EditorNode::~EditorNode() { EditorInspector::cleanup_plugins(); + EditorTranslationParser::get_singleton()->clean_parsers(); remove_print_handler(&print_handler); memdelete(EditorHelp::get_doc_data()); diff --git a/editor/editor_translation_parser.cpp b/editor/editor_translation_parser.cpp index 3f4864ad1e..da191fbc92 100644 --- a/editor/editor_translation_parser.cpp +++ b/editor/editor_translation_parser.cpp @@ -147,6 +147,11 @@ void EditorTranslationParser::remove_parser(const Ref<EditorTranslationParserPlu } } +void EditorTranslationParser::clean_parsers() { + standard_parsers.clear(); + custom_parsers.clear(); +} + EditorTranslationParser *EditorTranslationParser::get_singleton() { if (!singleton) { singleton = memnew(EditorTranslationParser); diff --git a/editor/editor_translation_parser.h b/editor/editor_translation_parser.h index 6d00bedfa4..fb8aa6ec9b 100644 --- a/editor/editor_translation_parser.h +++ b/editor/editor_translation_parser.h @@ -64,6 +64,7 @@ public: Ref<EditorTranslationParserPlugin> get_parser(const String &p_extension) const; void add_parser(const Ref<EditorTranslationParserPlugin> &p_parser, ParserType p_type); void remove_parser(const Ref<EditorTranslationParserPlugin> &p_parser, ParserType p_type); + void clean_parsers(); EditorTranslationParser(); ~EditorTranslationParser(); |
