diff options
Diffstat (limited to 'source/blender/blenkernel/intern/object.c')
-rw-r--r-- | source/blender/blenkernel/intern/object.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index 8ac067c0316..7aa23dc6c2b 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -678,9 +678,10 @@ void BKE_object_unlink(Object *ob) SpaceOops *so = (SpaceOops *)sl; if (so->treestore) { - TreeStoreElem *tselem = so->treestore->data; - int i; - for (i = 0; i < so->treestore->usedelem; i++, tselem++) { + TreeStoreElem *tselem; + BLI_mempool_iter iter; + BLI_mempool_iternew(so->treestore, &iter); + while ((tselem = BLI_mempool_iterstep(&iter))) { if (tselem->id == (ID *)ob) tselem->id = NULL; } } |