From 08d37419805aa1fe7e8041f09e3026a160c8730b Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 11 Feb 2010 16:54:25 +0000 Subject: fix for crash when running in background mode and adjusting materials --- source/blender/blenkernel/intern/icons.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/intern/icons.c b/source/blender/blenkernel/intern/icons.c index b9e3c593ddf..d6f30506fda 100644 --- a/source/blender/blenkernel/intern/icons.c +++ b/source/blender/blenkernel/intern/icons.c @@ -49,6 +49,7 @@ #include "BKE_icons.h" #include "BKE_utildefines.h" +#include "BKE_global.h" /* only for G.background test */ #include "BLO_sys_types.h" // for intptr_t support @@ -217,7 +218,7 @@ void BKE_icon_changed(int id) { Icon* icon = 0; - if (!id) return; + if (!id || G.background) return; icon = BLI_ghash_lookup(gIcons, SET_INT_IN_POINTER(id)); @@ -239,7 +240,7 @@ int BKE_icon_getid(struct ID* id) { Icon* new_icon = 0; - if (!id) + if (!id || G.background) return 0; if (id->icon_id) -- cgit v1.2.3