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:
@ -701,7 +701,7 @@ void LiveEditor::_res_set_func(int p_id, const StringName &p_prop, const Variant
|
||||
return;
|
||||
}
|
||||
|
||||
Ref<Resource> r = ResourceCache::get(resp);
|
||||
Ref<Resource> r = ResourceCache::get_ref(resp);
|
||||
if (!r.is_valid()) {
|
||||
return;
|
||||
}
|
||||
@ -728,7 +728,7 @@ void LiveEditor::_res_call_func(int p_id, const StringName &p_method, const Vari
|
||||
return;
|
||||
}
|
||||
|
||||
Ref<Resource> r = ResourceCache::get(resp);
|
||||
Ref<Resource> r = ResourceCache::get_ref(resp);
|
||||
if (!r.is_valid()) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user