Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2015-05-04 05:40:38 +0300
committerCampbell Barton <ideasman42@gmail.com>2015-05-04 09:01:20 +0300
commit8d5e57748a777a76dbbe85d432d7d8364775713a (patch)
tree365745db752fc34fb4d0544913eacd3a0801e0ff /source/blender/blenkernel/intern/library.c
parentda8a62adcedecf1a7f7f21f47c2ad8153649b423 (diff)
Cleanup: WM_main_remove_notifier_reference
Assumed the `reference` pointer is an ID, currently true, but may not always be. Add a callback specifically for this purpose since cleaning up notifiers and space-types are different operations.
Diffstat (limited to 'source/blender/blenkernel/intern/library.c')
-rw-r--r--source/blender/blenkernel/intern/library.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c
index ccc373b6eb4..42856e82062 100644
--- a/source/blender/blenkernel/intern/library.c
+++ b/source/blender/blenkernel/intern/library.c
@@ -877,6 +877,12 @@ void BKE_library_callback_free_notifier_reference_set(void (*func)(const void *)
free_notifier_reference_cb = func;
}
+static void (*free_editor_id_reference_cb)(const ID *) = NULL;
+
+void BKE_library_callback_free_editor_id_reference_set(void (*func)(const ID *))
+{
+ free_editor_id_reference_cb = func;
+}
static void animdata_dtar_clear_cb(ID *UNUSED(id), AnimData *adt, void *userdata)
{
@@ -1034,8 +1040,13 @@ void BKE_libblock_free_ex(Main *bmain, void *idv, bool do_id_user)
/* avoid notifying on removed data */
BKE_main_lock(bmain);
- if (free_notifier_reference_cb)
+ if (free_notifier_reference_cb) {
free_notifier_reference_cb(id);
+ }
+
+ if (free_editor_id_reference_cb) {
+ free_editor_id_reference_cb(id);
+ }
BLI_remlink(lb, id);