summaryrefslogtreecommitdiffstats
path: root/core/variant/callable.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <remi@verschelde.fr>2024-06-04 10:16:14 +0200
committerGitHub <noreply@github.com>2024-06-04 10:16:14 +0200
commit7b63ac488e6e27b1d712bbd6b55afae46c0028ff (patch)
treefb359f139e3005458cf62a71114a0d1da6461d77 /core/variant/callable.cpp
parent7c2d65ff660684931255d404ee116f453c54adc8 (diff)
parent4463e7dee9f4b0ccbd384b95e48f32c105ac2947 (diff)
downloadredot-engine-7b63ac488e6e27b1d712bbd6b55afae46c0028ff.tar.gz
Merge pull request #92722 from rune-scape/fix-callable-crash
Fix callable not clearing freed pointer
Diffstat (limited to 'core/variant/callable.cpp')
-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;
}
}
}