summaryrefslogtreecommitdiff
path: root/modules/gdscript/gdscript.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'modules/gdscript/gdscript.cpp')
-rw-r--r--modules/gdscript/gdscript.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/modules/gdscript/gdscript.cpp b/modules/gdscript/gdscript.cpp
index 541d46a2af..0263e32c5b 100644
--- a/modules/gdscript/gdscript.cpp
+++ b/modules/gdscript/gdscript.cpp
@@ -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;
}
}
}