summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-12-11 09:26:39 +0100
committerGitHub <noreply@github.com>2022-12-11 09:26:39 +0100
commit1d19b0750e7d7f630ad3a55ef6fbc9d3ba6c8a94 (patch)
tree644dd8d87050219b31a398a4aeb518593f7515d1
parent486d61b84f3f998168388f52bac6409b3609af71 (diff)
parent0139bd04b2bea66d833faf40f4d32bc9f82501dd (diff)
Merge pull request #69883 from adamscott/fix-gdscript-cache-clear-crash
Fix `GDScriptCache::clear()` crash when clearing packed scenes
-rw-r--r--modules/gdscript/gdscript_cache.cpp6
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();