From 2de8bc00a1c46b8c97687a02a8e0bbd1f76ab0b9 Mon Sep 17 00:00:00 2001 From: kobewi Date: Thu, 18 Jan 2024 12:29:58 +0100 Subject: [PATCH] Simplify RefCounted check in free() --- core/object/object.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/object/object.cpp b/core/object/object.cpp index 5a776e2106c8..3901c4835de3 100644 --- a/core/object/object.cpp +++ b/core/object/object.cpp @@ -728,7 +728,7 @@ Variant Object::callp(const StringName &p_method, const Variant **p_args, int p_ r_error.expected = 0; return Variant(); } - if (Object::cast_to(this)) { + if (is_ref_counted()) { r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD; ERR_FAIL_V_MSG(Variant(), "Can't 'free' a reference."); }