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 committed 2024-08-03 20:52:44 -07:00
1 parent 6e8fa6dd50
commit e680369d5b
3 files changed
+35 -27

No files matched your search

+3 -1
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);
}
}