Commit: 033c532bfb71f34d7cf9d4a1e2075f6ac50a40a2
Author: Bastien Montagne
Date:   Fri Jun 12 09:55:04 2015 +0200
Branches: blender-v2.75-release
https://developer.blender.org/rB033c532bfb71f34d7cf9d4a1e2075f6ac50a40a2

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.

===================================================================

M       source/blender/windowmanager/intern/wm_operators.c

===================================================================

diff --git a/source/blender/windowmanager/intern/wm_operators.c 
b/source/blender/windowmanager/intern/wm_operators.c
index cd97293..c39d0fc 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 {

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to