From 4463e7dee9f4b0ccbd384b95e48f32c105ac2947 Mon Sep 17 00:00:00 2001 From: rune-scape Date: Sun, 2 Jun 2024 21:00:53 -0700 Subject: [PATCH] fix callable not clearing freed pointer --- core/variant/callable.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/variant/callable.cpp b/core/variant/callable.cpp index c6fbfd93a14..667aae879ca 100644 --- a/core/variant/callable.cpp +++ b/core/variant/callable.cpp @@ -324,6 +324,7 @@ void Callable::operator=(const Callable &p_callable) { if (custom->ref_count.unref()) { memdelete(custom); + custom = nullptr; } } @@ -428,6 +429,7 @@ Callable::~Callable() { if (is_custom()) { if (custom->ref_count.unref()) { memdelete(custom); + custom = nullptr; } } }