CTX_wm_reports needs to return NULL when wm.manager is NULL (this happens in backgrou...
authorMartin Poirier <theeth@yahoo.com>
Fri, 14 Aug 2009 18:18:19 +0000 (18:18 +0000)
committerMartin Poirier <theeth@yahoo.com>
Fri, 14 Aug 2009 18:18:19 +0000 (18:18 +0000)
This fixes a segfault on quit in background mode. Now it reports unfreed datablocks, someone should fix that.

source/blender/blenkernel/intern/context.c

index 78c29a96bff629249044fa96976e3964d6e76fc3..d1e228f83b687c480ba80e3eb511a40e832908cc 100644 (file)
@@ -217,7 +217,10 @@ struct ARegion *CTX_wm_menu(const bContext *C)
 
 struct ReportList *CTX_wm_reports(const bContext *C)
 {
-       return &(C->wm.manager->reports);
+       if (C->wm.manager)
+               return &(C->wm.manager->reports);
+
+       return NULL;
 }
 
 View3D *CTX_wm_view3d(const bContext *C)