always print reports immediately when running in background mode.
authorCampbell Barton <ideasman42@gmail.com>
Fri, 23 Apr 2010 11:48:17 +0000 (11:48 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 23 Apr 2010 11:48:17 +0000 (11:48 +0000)
source/blender/blenkernel/intern/report.c

index a7800ddc12a0690852fb54724b6ebfaba4bbc7e1..da8b018d3f813f309d35730d846e6c6126eb8e84 100644 (file)
@@ -31,6 +31,7 @@
 #include "BLI_dynstr.h"
 
 #include "BKE_report.h"
+#include "BKE_global.h" /* G.background only */
 
 #include <stdarg.h>
 #include <stdio.h>
@@ -93,6 +94,10 @@ void BKE_report(ReportList *reports, ReportType type, const char *message)
        Report *report;
        int len;
 
+    /* exception, print and return in background, no reason to store a list */
+    if(G.background)
+        reports= NULL;
+
        if(!reports || ((reports->flag & RPT_PRINT) && (type >= reports->printlevel))) {
                printf("%s: %s\n", report_type_str(type), message);
                fflush(stdout); /* this ensures the message is printed before a crash */