Преглед изворни кода

Merge pull request #18792 from PJB3005/18-05-11-objectdb-verbose-mono

Fixes ObjectDB leak printout with mono.
Rémi Verschelde пре 7 година
родитељ
комит
6e32a2886f
1 измењених фајлова са 6 додато и 0 уклоњено
  1. 6 0
      modules/mono/csharp_script.cpp

+ 6 - 0
modules/mono/csharp_script.cpp

@@ -1732,6 +1732,12 @@ void CSharpScript::_clear() {
 
 
 Variant CSharpScript::call(const StringName &p_method, const Variant **p_args, int p_argcount, Variant::CallError &r_error) {
 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;
 	GDMonoClass *top = script_class;
 
 
 	while (top && top != native) {
 	while (top && top != native) {