From f2e8df2ee284c324d8bdff963d3cf16ea5c93355 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Tue, 16 Jul 2013 20:11:08 +0000 Subject: [PATCH] Remove workaround for draw object free Code around draw objects became safe for threading and no special workaround is needed in scene update anymore. Unused buffers will be freed next time window is drawing. Some further tweaks maybe needed to how buffers are freeing, but things shall work for now nice and stable. --- source/blender/blenkernel/intern/scene.c | 28 ------------------------ 1 file changed, 28 deletions(-) diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index 88e842dc94b..53c139309d1 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -1324,34 +1324,6 @@ static void scene_update_objects_threaded(Scene *scene, Scene *scene_parent) */ BLI_begin_threaded_malloc(); - /* XXX: Releasing DrawObject is not thread safe, but adding lock - * around it is gonna to harm even more. So for now let's - * free all caches from main thread. - * - * TODO(sergey): Making DrawObject thread-safe is a nice task on - * it's own and it'll also make it possible to remove - * this hack. - */ - { - Base *base; - for (base = scene->base.first; base; base = base->next) { - Object *ob = base->object; - - if (ob->recalc & OB_RECALC_ALL) { - BKE_object_free_derived_caches(ob); - - if (ob->dup_group && (ob->transflag & OB_DUPLIGROUP)) { - GroupObject *go; - for (go = ob->dup_group->gobject.first; go; go = go->next) { - if (go->ob && go->ob->recalc) { - BKE_object_free_derived_caches(go->ob); - } - } - } - } - } - } - state.scene = scene; state.scene_parent = scene_parent; #ifdef ENABLE_THREAD_STATISTICS