From d44d5b06b76a54fba11e1091b1c245904c5c9fb4 Mon Sep 17 00:00:00 2001 From: rune-scape Date: Fri, 2 Aug 2024 20:55:13 -0700 Subject: [PATCH] Fix too many parsers getting removed --- modules/gdscript/gdscript_cache.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/gdscript/gdscript_cache.cpp b/modules/gdscript/gdscript_cache.cpp index 2b1184bcb95f..6eb35c9ac1f1 100644 --- a/modules/gdscript/gdscript_cache.cpp +++ b/modules/gdscript/gdscript_cache.cpp @@ -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); } }