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
|
|
@ -5455,7 +5455,7 @@ void CanvasItemEditorViewport::_create_nodes(Node *parent, Node *child, String &
|
|||
}
|
||||
child->set_name(name);
|
||||
|
||||
Ref<Texture2D> texture = Ref<Texture2D>(Object::cast_to<Texture2D>(ResourceCache::get(path)));
|
||||
Ref<Texture2D> texture = ResourceCache::get_ref(path);
|
||||
|
||||
if (parent) {
|
||||
editor_data->get_undo_redo().add_do_method(parent, "add_child", child, true);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue