fix callable not clearing freed pointer

This commit is contained in:
rune-scape 2024-06-02 21:00:53 -07:00
parent 505da68b26
commit 4463e7dee9
1 changed files with 2 additions and 0 deletions

View File

@ -324,6 +324,7 @@ void Callable::operator=(const Callable &p_callable) {
if (custom->ref_count.unref()) { if (custom->ref_count.unref()) {
memdelete(custom); memdelete(custom);
custom = nullptr;
} }
} }
@ -428,6 +429,7 @@ Callable::~Callable() {
if (is_custom()) { if (is_custom()) {
if (custom->ref_count.unref()) { if (custom->ref_count.unref()) {
memdelete(custom); memdelete(custom);
custom = nullptr;
} }
} }
} }