mirror of
https://github.com/godotengine/godot.git
synced 2025-10-20 00:13:30 +00:00
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:
parent
c18d0f2035
commit
e772b65d92
15 changed files with 117 additions and 126 deletions
|
@ -487,7 +487,7 @@ void DependencyRemoveDialog::show(const Vector<String> &p_folders, const Vector<
|
|||
void DependencyRemoveDialog::ok_pressed() {
|
||||
for (int i = 0; i < files_to_delete.size(); ++i) {
|
||||
if (ResourceCache::has(files_to_delete[i])) {
|
||||
Resource *res = ResourceCache::get(files_to_delete[i]);
|
||||
Ref<Resource> res = ResourceCache::get_ref(files_to_delete[i]);
|
||||
res->set_path("");
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue