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:
Diffstat (limited to 'source/blender/blenlib/intern/listbase.c')
-rw-r--r--source/blender/blenlib/intern/listbase.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/blenlib/intern/listbase.c b/source/blender/blenlib/intern/listbase.c
index 1064c8ac1bf..3194593374f 100644
--- a/source/blender/blenlib/intern/listbase.c
+++ b/source/blender/blenlib/intern/listbase.c
@@ -347,11 +347,11 @@ void BLI_duplicatelist(ListBase *list1, ListBase *list2) /* copy from 2 to 1 */
{
struct Link *link1, *link2;
+ /* in this order, to ensure it works if list1 == list2 */
+ link2= list2->first;
list1->first= list1->last= 0;
- link2= list2->first;
while(link2) {
-
link1= MEM_dupallocN(link2);
BLI_addtail(list1, link1);