From 520fb5c8cd3d57e6c2b5676aae73008a1a038300 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Fri, 12 Jun 2015 09:55:04 +0200 Subject: Fix T45041: (2.75RC) blender crashes when I choose 'Refresh DataBlock Previews'. Not sure where this sneaked in, but we for sure need a valid context (otherwise we'd need to pass a Main alog too). This is to be backported to final 2.75. --- source/blender/windowmanager/intern/wm_operators.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source/blender/windowmanager') diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index cd97293516d..c39d0fc2a68 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -4777,6 +4777,7 @@ static void WM_OT_dependency_relations(wmOperatorType *ot) /* *************************** Mat/tex/etc. previews generation ************* */ typedef struct PreviewsIDEnsureStack { + bContext *C; Scene *scene; BLI_LINKSTACK_DECLARE(id_stack, ID *); @@ -4801,7 +4802,7 @@ static bool previews_id_ensure_callback(void *todo_v, ID **idptr, int UNUSED(cd_ if (id && (id->flag & LIB_DOIT)) { if (ELEM(GS(id->name), ID_MA, ID_TE, ID_IM, ID_WO, ID_LA)) { - previews_id_ensure(NULL, todo->scene, id); + previews_id_ensure(todo->C, todo->scene, id); } id->flag &= ~LIB_DOIT; /* Tag the ID as done in any case. */ BLI_LINKSTACK_PUSH(todo->id_stack, id); @@ -4826,6 +4827,7 @@ static int previews_ensure_exec(bContext *C, wmOperator *UNUSED(op)) for (scene = bmain->scene.first; scene; scene = scene->id.next) { preview_id_stack.scene = scene; + preview_id_stack.C = C; id = (ID *)scene; do { -- cgit v1.2.3