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
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2021-10-19 05:20:48 +0300
committerCampbell Barton <ideasman42@gmail.com>2021-10-19 05:22:36 +0300
commitda949c357405ad01b00e83177335f55d113a8619 (patch)
treebaa035a4559e3c135e2725f27d5d9175298c914c /source
parentc4f733a76cd7b99d3a47578eadc83ce064551916 (diff)
Fix crash on file load in unregistering bke::AssetLibraryService
Use mutable iterator to support callbacks removing themselves.
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/intern/callbacks.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/callbacks.c b/source/blender/blenkernel/intern/callbacks.c
index 87d5961b12e..7fd3048b740 100644
--- a/source/blender/blenkernel/intern/callbacks.c
+++ b/source/blender/blenkernel/intern/callbacks.c
@@ -35,10 +35,9 @@ void BKE_callback_exec(struct Main *bmain,
const int num_pointers,
eCbEvent evt)
{
+ /* Use mutable iteration so handlers are able to remove themselves. */
ListBase *lb = &callback_slots[evt];
- bCallbackFuncStore *funcstore;
-
- for (funcstore = lb->first; funcstore; funcstore = funcstore->next) {
+ LISTBASE_FOREACH_MUTABLE (bCallbackFuncStore *, funcstore, lb) {
funcstore->func(bmain, pointers, num_pointers, funcstore->arg);
}
}