diff --git a/modules/gdscript/gdscript.cpp b/modules/gdscript/gdscript.cpp index 0fb2de89146e..a8d996430d1b 100644 --- a/modules/gdscript/gdscript.cpp +++ b/modules/gdscript/gdscript.cpp @@ -1482,6 +1482,11 @@ void GDScript::clear() { memdelete(E); } functions_to_clear.clear(); + +#ifdef TOOLS_ENABLED + base_cache = Ref(); +#endif + base = Ref(); } void GDScript::cancel_pending_functions(bool warn) {