diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2016-11-15 18:36:47 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2016-11-15 18:39:48 +0300 |
commit | f2690673ba4966542684d5b6f17d0fa329c33b82 (patch) | |
tree | 5f1dbbf5dd3f29b85485e336f05389f771fab6f2 /source/blender/blenkernel/intern | |
parent | af0e6b31a5b06521ef541d8e2adc2b0777c880f9 (diff) |
Get rid of 'drivers unlinking' code in `BKE_libblock_free_data()`
This has nothing to do here (freeing is not unlinking/remapping!), and
was actually redoing something already taken care of by
`BKE_libblock_relink_ex()` call in `BKE_libblock_free_ex()`.
Also, gives some noticeable speedup when removing datablocks with
do_unlink=True, about 5 to 10% quicker e.g. when deleting all objects
from a py console, in a big production file...
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/library_remap.c | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/source/blender/blenkernel/intern/library_remap.c b/source/blender/blenkernel/intern/library_remap.c index 4133342f3f2..4e5ece1fde5 100644 --- a/source/blender/blenkernel/intern/library_remap.c +++ b/source/blender/blenkernel/intern/library_remap.c @@ -691,20 +691,10 @@ static void animdata_dtar_clear_cb(ID *UNUSED(id), AnimData *adt, void *userdata void BKE_libblock_free_data(Main *bmain, ID *id) { - BKE_libblock_free_data_ex(bmain, id, true); -} - -void BKE_libblock_free_data_ex(Main *bmain, ID *id, const bool do_id_user) -{ if (id->properties) { IDP_FreeProperty(id->properties); MEM_freeN(id->properties); } - - if (do_id_user) { - /* this ID may be a driver target! */ - BKE_animdata_main_cb(bmain, animdata_dtar_clear_cb, (void *)id); - } } /** @@ -852,7 +842,7 @@ void BKE_libblock_free_ex(Main *bmain, void *idv, const bool do_id_user, const b BLI_remlink(lb, id); - BKE_libblock_free_data_ex(bmain, id, do_id_user); + BKE_libblock_free_data(bmain, id); BKE_main_unlock(bmain); MEM_freeN(id); |