Merging r58362 through r58463 from trunk into soc-2013-depsgraph_mt
[blender.git] / source / blender / blenkernel / intern / material.c
index e14b51975c8e19682fdde4ec44096b7d9c6b0f8a..5f9aafa219f14d7f70e310d16d753e9beadff8e9 100644 (file)
@@ -1275,7 +1275,9 @@ int object_remove_material_slot(Object *ob)
        /* check indices from mesh */
        if (ELEM4(ob->type, OB_MESH, OB_CURVE, OB_SURF, OB_FONT)) {
                data_delete_material_index_id((ID *)ob->data, actcol - 1);
-               BKE_displist_free(&ob->disp);
+               if (ob->curve_cache) {
+                       BKE_displist_free(&ob->curve_cache->disp);
+               }
        }
 
        return TRUE;