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:
authorBastien Montagne <montagne29@wanadoo.fr>2019-02-18 18:13:11 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2019-02-18 19:16:33 +0300
commit00d2e9096f8b57027e5ff48b057856d5b4b0f3cf (patch)
tree1636ea663910c56bd02a9c06e38f7ebcb7ee3586 /source
parent4c2330bd537a6a6d1fa0030fe0bb14380dc7eeb6 (diff)
ID management: use FOREACH_MAIN_ID in some places.
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/intern/blendfile.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/source/blender/blenkernel/intern/blendfile.c b/source/blender/blenkernel/intern/blendfile.c
index c410e6a718c..e7ea38d845b 100644
--- a/source/blender/blenkernel/intern/blendfile.c
+++ b/source/blender/blenkernel/intern/blendfile.c
@@ -460,23 +460,16 @@ bool BKE_blendfile_read_from_memfile(
void BKE_blendfile_read_make_empty(bContext *C)
{
Main *bmain = CTX_data_main(C);
-
- ListBase *lbarray[MAX_LIBARRAY];
ID *id;
- int a;
- a = set_listbasepointers(bmain, lbarray);
- while (a--) {
- id = lbarray[a]->first;
- if (id != NULL) {
- if (ELEM(GS(id->name), ID_SCE, ID_SCR, ID_WM, ID_WS)) {
- continue;
- }
- while ((id = lbarray[a]->first)) {
- BKE_id_delete(bmain, id);
- }
+ FOREACH_MAIN_ID_BEGIN(bmain, id)
+ {
+ if (ELEM(GS(id->name), ID_SCE, ID_SCR, ID_WM, ID_WS)) {
+ break; /* Only breaks iter on that ID type, and continues with IDs of next type. */
}
+ BKE_id_delete(bmain, id);
}
+ FOREACH_MAIN_ID_END;
}
/* only read the userdef from a .blend */