Remake resource thread safety and API
* Ensures thread safety when resources are destroyed. * Simplified API by always forcing `ResourceCache::get_ref`, which needs less hacks and is fully thread safe. * Removed RWLock for resources because its not possible to use for the new logic. Should not be a problem. Supersedes #57533
This commit is contained in:
@@ -193,10 +193,7 @@ void EditorFolding::load_scene_folding(Node *p_scene, const String &p_path) {
|
||||
|
||||
for (int i = 0; i < res_unfolds.size(); i += 2) {
|
||||
String path2 = res_unfolds[i];
|
||||
Ref<Resource> res;
|
||||
if (ResourceCache::has(path2)) {
|
||||
res = Ref<Resource>(ResourceCache::get(path2));
|
||||
}
|
||||
Ref<Resource> res = ResourceCache::get_ref(path2);
|
||||
if (res.is_null()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user