diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2019-09-19 13:03:25 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2019-09-19 13:06:07 +0300 |
commit | 658d7eeed27454a5d9729cd78eaa6289f2518007 (patch) | |
tree | 9fb20ba5dac642a7055fec67fa6138c639d25df1 /source/blender/blenkernel | |
parent | 7a78bc5d2491cd559660332eeb5c45551a720141 (diff) |
Clean-up/safety check in new BKE_mesh_copy_settings().
From rBe7a514369fe70, since I did not have time to do proper review
in D5808...
Note that we could also consider that shallow copy of src should never
be dst of that function and add some asserts instead. For now going the
safest and simplest way though.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/mesh.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c index 20c221d5e28..6c3c083b39a 100644 --- a/source/blender/blenkernel/intern/mesh.c +++ b/source/blender/blenkernel/intern/mesh.c @@ -672,7 +672,7 @@ void BKE_mesh_copy_settings(Mesh *me_dst, const Mesh *me_src) /* Copy texture space. */ me_dst->texflag = me_src->texflag; - if (me_dst->bb) { + if (me_dst->bb != NULL && me_dst->bb != me_src->bb) { MEM_freeN(me_dst->bb); } me_dst->bb = MEM_dupallocN(me_src->bb); @@ -681,7 +681,7 @@ void BKE_mesh_copy_settings(Mesh *me_dst, const Mesh *me_src) copy_v3_v3(me_dst->size, me_src->size); /* Copy materials. */ - if (me_dst->mat != NULL) { + if (me_dst->mat != NULL && me_dst->mat != me_src->mat) { MEM_freeN(me_dst->mat); } me_dst->mat = MEM_dupallocN(me_src->mat); |