mirror of
https://github.com/godotengine/godot.git
synced 2024-11-22 12:12:28 +00:00
Merge pull request #34296 from timothyqiu/lock-33072
Fixes crash when using Resource::_take_over_path
This commit is contained in:
commit
e62941fb53
@ -68,7 +68,10 @@ void Resource::set_path(const String &p_path, bool p_take_over) {
|
||||
if (p_take_over) {
|
||||
|
||||
ResourceCache::lock->write_lock();
|
||||
ResourceCache::resources.get(p_path)->set_name("");
|
||||
Resource **res = ResourceCache::resources.getptr(p_path);
|
||||
if (res) {
|
||||
(*res)->set_name("");
|
||||
}
|
||||
ResourceCache::lock->write_unlock();
|
||||
} else {
|
||||
ResourceCache::lock->read_lock();
|
||||
|
Loading…
Reference in New Issue
Block a user