1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-05 12:10:55 +00:00

GDScript: Fix too many calls to 'remove_parser'

+fix excessive memory allocations when 'load'ing many dependant scripts
+fix excessive calls to vformat
This commit is contained in:
rune-scape
2024-08-02 20:55:13 -07:00
parent 6e8fa6dd50
commit e680369d5b
3 changed files with 35 additions and 27 deletions

View File

@@ -135,8 +135,10 @@ void GDScriptParserRef::clear() {
GDScriptParserRef::~GDScriptParserRef() {
clear();
if (!abandoned) {
GDScriptCache::remove_parser(path);
MutexLock lock(GDScriptCache::singleton->mutex);
GDScriptCache::singleton->parser_map.erase(path);
}
}