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:
authorBastien Montagne <montagne29@wanadoo.fr>2017-06-15 16:54:11 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2017-06-15 16:54:11 +0300
commita35e733ff18fcdf5b57937cd85f9bcd6aec236b0 (patch)
tree30a1508ee4a7b6ba4df705721fb2133b70a20798 /source/blender/blenkernel/intern/mesh.c
parent60a36f202837037b6f6d31d4d067ec783f53d0ba (diff)
parent880e96dd667aedea17353803bcc5721f3cc34d50 (diff)
Merge branch 'master' into blender2.8
Conflicts: source/blender/collada/MeshImporter.cpp source/blender/editors/object/object_add.c source/blender/editors/screen/screen_edit.c
Diffstat (limited to 'source/blender/blenkernel/intern/mesh.c')
-rw-r--r--source/blender/blenkernel/intern/mesh.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c
index 3717a9eb22a..6a0c0c14a23 100644
--- a/source/blender/blenkernel/intern/mesh.c
+++ b/source/blender/blenkernel/intern/mesh.c
@@ -1395,9 +1395,7 @@ void BKE_mesh_from_nurbs_displist(Object *ob, ListBase *dispbase, const bool use
cu->mat = NULL;
cu->totcol = 0;
- if (ob->data) {
- BKE_libblock_free(bmain, ob->data);
- }
+ /* Do not decrement ob->data usercount here, it's done at end of func with BKE_libblock_free_us() call. */
ob->data = me;
ob->type = OB_MESH;
@@ -1407,11 +1405,14 @@ void BKE_mesh_from_nurbs_displist(Object *ob, ListBase *dispbase, const bool use
if (ob1->data == cu) {
ob1->type = OB_MESH;
+ id_us_min((ID *)ob1->data);
ob1->data = ob->data;
- id_us_plus((ID *)ob->data);
+ id_us_plus((ID *)ob1->data);
}
ob1 = ob1->id.next;
}
+
+ BKE_libblock_free_us(bmain, cu);
}
void BKE_mesh_from_nurbs(Object *ob)