- was freeing reports on freed listbases
[blender-staging.git] / source / blender / blenkernel / intern / report.c
index 3e3dd4b0af0251904a7c9c27f728d24484600aac..391adfb762ac19fa57c7927861aa793d1d610bfe 100644 (file)
@@ -73,15 +73,21 @@ void BKE_reports_init(ReportList *reports, int flag)
 
 void BKE_reports_clear(ReportList *reports)
 {
-       Report *report;
+       Report *report, *report_next;
 
        if(!reports)
                return;
 
-       for(report=reports->list.first; report; report=report->next)
+       report= reports->list.first;
+
+       while (report) {
+               report_next= report->next;
                MEM_freeN(report->message);
+               MEM_freeN(report);
+               report= report_next;
+       }
 
-       BLI_freelistN(&reports->list);
+       reports->list.first= reports->list.last= NULL;
 }
 
 void BKE_report(ReportList *reports, ReportType type, const char *message)