You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-07 12:30:27 +00:00
[GDScript] Add static HashMap cleanup.
This commit is contained in:
@@ -71,6 +71,10 @@ static StringName get_real_class_name(const StringName &p_source) {
|
|||||||
return p_source;
|
return p_source;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GDScriptAnalyzer::cleanup() {
|
||||||
|
underscore_map.clear();
|
||||||
|
}
|
||||||
|
|
||||||
static GDScriptParser::DataType make_callable_type(const MethodInfo &p_info) {
|
static GDScriptParser::DataType make_callable_type(const MethodInfo &p_info) {
|
||||||
GDScriptParser::DataType type;
|
GDScriptParser::DataType type;
|
||||||
type.type_source = GDScriptParser::DataType::ANNOTATED_EXPLICIT;
|
type.type_source = GDScriptParser::DataType::ANNOTATED_EXPLICIT;
|
||||||
|
|||||||
@@ -113,6 +113,8 @@ public:
|
|||||||
Error analyze();
|
Error analyze();
|
||||||
|
|
||||||
GDScriptAnalyzer(GDScriptParser *p_parser);
|
GDScriptAnalyzer(GDScriptParser *p_parser);
|
||||||
|
|
||||||
|
static void cleanup();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // GDSCRIPT_ANALYZER_H
|
#endif // GDSCRIPT_ANALYZER_H
|
||||||
|
|||||||
@@ -94,6 +94,10 @@ Variant::Type GDScriptParser::get_builtin_type(const StringName &p_type) {
|
|||||||
return Variant::VARIANT_MAX;
|
return Variant::VARIANT_MAX;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GDScriptParser::cleanup() {
|
||||||
|
builtin_types.clear();
|
||||||
|
}
|
||||||
|
|
||||||
GDScriptFunctions::Function GDScriptParser::get_builtin_function(const StringName &p_name) {
|
GDScriptFunctions::Function GDScriptParser::get_builtin_function(const StringName &p_name) {
|
||||||
for (int i = 0; i < GDScriptFunctions::FUNC_MAX; i++) {
|
for (int i = 0; i < GDScriptFunctions::FUNC_MAX; i++) {
|
||||||
if (p_name == GDScriptFunctions::get_func_name(GDScriptFunctions::Function(i))) {
|
if (p_name == GDScriptFunctions::get_func_name(GDScriptFunctions::Function(i))) {
|
||||||
|
|||||||
@@ -1335,6 +1335,7 @@ public:
|
|||||||
void print_tree(const GDScriptParser &p_parser);
|
void print_tree(const GDScriptParser &p_parser);
|
||||||
};
|
};
|
||||||
#endif // DEBUG_ENABLED
|
#endif // DEBUG_ENABLED
|
||||||
|
static void cleanup();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // GDSCRIPT_PARSER_H
|
#endif // GDSCRIPT_PARSER_H
|
||||||
|
|||||||
@@ -35,6 +35,7 @@
|
|||||||
#include "core/os/dir_access.h"
|
#include "core/os/dir_access.h"
|
||||||
#include "core/os/file_access.h"
|
#include "core/os/file_access.h"
|
||||||
#include "gdscript.h"
|
#include "gdscript.h"
|
||||||
|
#include "gdscript_analyzer.h"
|
||||||
#include "gdscript_cache.h"
|
#include "gdscript_cache.h"
|
||||||
#include "gdscript_tokenizer.h"
|
#include "gdscript_tokenizer.h"
|
||||||
|
|
||||||
@@ -148,4 +149,7 @@ void unregister_gdscript_types() {
|
|||||||
EditorTranslationParser::get_singleton()->remove_parser(gdscript_translation_parser_plugin, EditorTranslationParser::STANDARD);
|
EditorTranslationParser::get_singleton()->remove_parser(gdscript_translation_parser_plugin, EditorTranslationParser::STANDARD);
|
||||||
gdscript_translation_parser_plugin.unref();
|
gdscript_translation_parser_plugin.unref();
|
||||||
#endif // TOOLS_ENABLED
|
#endif // TOOLS_ENABLED
|
||||||
|
|
||||||
|
GDScriptParser::cleanup();
|
||||||
|
GDScriptAnalyzer::cleanup();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user