diff options
author | Adam Scott <ascott.ca@gmail.com> | 2022-12-10 18:56:34 -0500 |
---|---|---|
committer | Adam Scott <ascott.ca@gmail.com> | 2022-12-10 19:10:12 -0500 |
commit | 0139bd04b2bea66d833faf40f4d32bc9f82501dd (patch) | |
tree | dfb3fe7fdd4a296750c06eb9ecffa21e77e35f1c | |
parent | a4131b61b10cb3a7fe0e1e76ed11dfebfa55e7e6 (diff) |
Fix `GDScriptCache::clear()` crash when clearing packed scenes
-rw-r--r-- | modules/gdscript/gdscript_cache.cpp | 6 |
1 files 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<String, HashSet<String>> &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(); |