You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
GDScript: Use pointer instead of references in cache
They are not supposed to be kept alive and this is cleaner and less error-prone than unreferencing the elements.
This commit is contained in:
@@ -603,10 +603,8 @@ Error GDScript::reload(bool p_keep_state) {
|
||||
}
|
||||
if (!source_path.empty()) {
|
||||
MutexLock lock(GDScriptCache::singleton->lock);
|
||||
Ref<GDScript> self(this);
|
||||
if (!GDScriptCache::singleton->shallow_gdscript_cache.has(source_path)) {
|
||||
GDScriptCache::singleton->shallow_gdscript_cache[source_path] = self;
|
||||
self->unreference();
|
||||
GDScriptCache::singleton->shallow_gdscript_cache[source_path] = this;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user