Browse Source

Fix fatal mono logs not getting logged to disk.

They aborted the application without flushing the log file.

Also there was a typo.
PJB3005 7 years ago
parent
commit
7368a0e0f0
1 changed files with 3 additions and 1 deletions
  1. 3 1
      modules/mono/mono_gd/gd_mono_log.cpp

+ 3 - 1
modules/mono/mono_gd/gd_mono_log.cpp

@@ -70,7 +70,9 @@ void gdmono_MonoLogCallback(const char *log_domain, const char *log_level, const
 	}
 	}
 
 
 	if (fatal) {
 	if (fatal) {
-		ERR_PRINTS("Mono: FALTAL ERROR, ABORTING! Logfile: " + GDMonoLog::get_singleton()->get_log_file_path() + "\n");
+		ERR_PRINTS("Mono: FATAL ERROR, ABORTING! Logfile: " + GDMonoLog::get_singleton()->get_log_file_path() + "\n");
+		// If we were to abort without flushing, the log wouldn't get written.
+		f->flush();
 		abort();
 		abort();
 	}
 	}
 }
 }