From 0139bd04b2bea66d833faf40f4d32bc9f82501dd Mon Sep 17 00:00:00 2001 From: Adam Scott Date: Sat, 10 Dec 2022 18:56:34 -0500 Subject: Fix `GDScriptCache::clear()` crash when clearing packed scenes --- modules/gdscript/gdscript_cache.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/modules/gdscript/gdscript_cache.cpp b/modules/gdscript/gdscript_cache.cpp index 1dc5e335a0..d1467eea95 100644 --- a/modules/gdscript/gdscript_cache.cpp +++ b/modules/gdscript/gdscript_cache.cpp @@ -415,10 +415,8 @@ void GDScriptCache::clear() { E->clear(); } - for (KeyValue> &E : singleton->packed_scene_dependencies) { - singleton->packed_scene_dependencies.erase(E.key); - singleton->packed_scene_cache.erase(E.key); - } + singleton->packed_scene_dependencies.clear(); + singleton->packed_scene_cache.clear(); parser_map_refs.clear(); singleton->parser_map.clear(); -- cgit v1.2.3