diff options
Diffstat (limited to 'source/blender/blenkernel/intern/library.c')
-rw-r--r-- | source/blender/blenkernel/intern/library.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c index 1674fbd55a7..da642f11e8d 100644 --- a/source/blender/blenkernel/intern/library.c +++ b/source/blender/blenkernel/intern/library.c @@ -823,6 +823,14 @@ void set_free_windowmanager_cb(void (*func)(bContext *C, wmWindowManager *) ) free_windowmanager_cb = func; } +static void (*free_notifier_reference_cb)(const void *) = NULL; + +void set_free_notifier_reference_cb(void (*func)(const void *) ) +{ + free_notifier_reference_cb = func; +} + + static void animdata_dtar_clear_cb(ID *UNUSED(id), AnimData *adt, void *userdata) { ChannelDriver *driver; @@ -969,6 +977,10 @@ void BKE_libblock_free(ListBase *lb, void *idv) break; } + /* avoid notifying on removed data */ + if (free_notifier_reference_cb) + free_notifier_reference_cb(id); + BLI_remlink(lb, id); BKE_libblock_free_data(id); |