浏览代码

Add missing packed scene cache clear inside `GDScriptCache::clear()`

Adam Scott 2 年之前
父节点
当前提交
59c6642f2a
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      modules/gdscript/gdscript_cache.cpp

+ 5 - 0
modules/gdscript/gdscript_cache.cpp

@@ -398,6 +398,11 @@ 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);
+	}
+
 	parser_map_refs.clear();
 	singleton->parser_map.clear();
 	singleton->shallow_gdscript_cache.clear();