From 206b7a6d1b378ff97e86e9e800c2a71f69b22856 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 8 Aug 2012 08:25:20 +0000 Subject: skip loading file selector icons when running in background mode. --- source/blender/editors/space_file/filelist.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'source/blender/editors/space_file/filelist.c') diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c index a23cb86bb76..2160e2eb3a0 100644 --- a/source/blender/editors/space_file/filelist.c +++ b/source/blender/editors/space_file/filelist.c @@ -383,6 +383,9 @@ void filelist_init_icons(void) short x, y, k; ImBuf *bbuf; ImBuf *ibuf; + + BLI_assert(G.background == FALSE); + #ifdef WITH_HEADLESS bbuf = NULL; #else @@ -408,6 +411,9 @@ void filelist_init_icons(void) void filelist_free_icons(void) { int i; + + BLI_assert(G.background == FALSE); + for (i = 0; i < SPECIAL_IMG_MAX; ++i) { IMB_freeImBuf(gSpecialFileImages[i]); gSpecialFileImages[i] = NULL; @@ -615,7 +621,10 @@ short filelist_changed(struct FileList *filelist) ImBuf *filelist_getimage(struct FileList *filelist, int index) { ImBuf *ibuf = NULL; - int fidx = 0; + int fidx = 0; + + BLI_assert(G.background == FALSE); + if ( (index < 0) || (index >= filelist->numfiltered) ) { return NULL; } @@ -629,7 +638,10 @@ ImBuf *filelist_geticon(struct FileList *filelist, int index) { ImBuf *ibuf = NULL; struct direntry *file = NULL; - int fidx = 0; + int fidx = 0; + + BLI_assert(G.background == FALSE); + if ( (index < 0) || (index >= filelist->numfiltered) ) { return NULL; } -- cgit v1.2.3