summaryrefslogtreecommitdiffstats
path: root/core/variant
diff options
context:
space:
mode:
authorrune-scape <spartacrafter@gmail.com>2024-06-02 21:00:53 -0700
committerrune-scape <spartacrafter@gmail.com>2024-06-02 21:22:16 -0700
commit4463e7dee9f4b0ccbd384b95e48f32c105ac2947 (patch)
treeac49295576144bffed9d03932b0f1d9ec6384cb2 /core/variant
parent505da68b261be6ed37b42422c61358ff9d208748 (diff)
downloadredot-engine-4463e7dee9f4b0ccbd384b95e48f32c105ac2947.tar.gz
fix callable not clearing freed pointer
Diffstat (limited to 'core/variant')
-rw-r--r--core/variant/callable.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/core/variant/callable.cpp b/core/variant/callable.cpp
index c6fbfd93a1..667aae879c 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;
}
}
}