Explorar o código

fix callable not clearing freed pointer

rune-scape hai 1 ano
pai
achega
4463e7dee9
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  1. 2 0
      core/variant/callable.cpp

+ 2 - 0
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;
 		}
 	}
 }