Ver código fonte

Fixes ObjectDB leak printout with mono.

Fixes #18767
Pieter-Jan Briers 7 anos atrás
pai
commit
27d70924a0
1 arquivos alterados com 6 adições e 0 exclusões
  1. 6 0
      modules/mono/csharp_script.cpp

+ 6 - 0
modules/mono/csharp_script.cpp

@@ -1726,6 +1726,12 @@ void CSharpScript::_clear() {
 
 Variant CSharpScript::call(const StringName &p_method, const Variant **p_args, int p_argcount, Variant::CallError &r_error) {
 
+	if (unlikely(GDMono::get_singleton() == NULL)) {
+		// Probably not the best error but eh.
+		r_error.error = Variant::CallError::CALL_ERROR_INSTANCE_IS_NULL;
+		return Variant();
+	}
+
 	GDMonoClass *top = script_class;
 
 	while (top && top != native) {