From 04648767fabda7d9461e32c89afcd806d0227547 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Tue, 24 Jun 2014 20:43:08 +0600 Subject: Make main library safe(er) for the threaded usage Added a lock to the Main which is getting acquired and released when modifying it's lists. Should not be any functional changes now, it just means Main is now considered safe without worrying about locks in the callee. --- source/blender/blenkernel/intern/material.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source/blender/blenkernel/intern/material.c') diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c index de3aea9267f..4f6f234c6e1 100644 --- a/source/blender/blenkernel/intern/material.c +++ b/source/blender/blenkernel/intern/material.c @@ -780,11 +780,13 @@ void test_object_materials(Main *bmain, ID *id) return; } + BLI_spin_lock(&bmain->lock); for (ob = bmain->object.first; ob; ob = ob->id.next) { if (ob->data == id) { BKE_material_resize_object(ob, *totcol, false); } } + BLI_spin_unlock(&bmain->lock); } void assign_material_id(ID *id, Material *ma, short act) -- cgit v1.2.3