[Bf-blender-cvs] [a66116f] blender-v2.77-release: Fix T48012: Knife Project crash

Campbell Barton noreply at git.blender.org
Tue Apr 5 10:38:57 CEST 2016


Commit: a66116f5439fa5ebf33a27867e846006ac20f78d
Author: Campbell Barton
Date:   Fri Apr 1 06:22:30 2016 +1100
Branches: blender-v2.77-release
https://developer.blender.org/rBa66116f5439fa5ebf33a27867e846006ac20f78d

Fix T48012: Knife Project crash

===================================================================

M	source/blender/bmesh/intern/bmesh_polygon_edgenet.c

===================================================================

diff --git a/source/blender/bmesh/intern/bmesh_polygon_edgenet.c b/source/blender/bmesh/intern/bmesh_polygon_edgenet.c
index 1ee96d4..e9d43eb 100644
--- a/source/blender/bmesh/intern/bmesh_polygon_edgenet.c
+++ b/source/blender/bmesh/intern/bmesh_polygon_edgenet.c
@@ -1485,12 +1485,26 @@ finally:
 #ifdef USE_PARTIAL_CONNECT
 	/* don't free 'vert_temp_pair_list', its part of the arena */
 	if (use_partial_connect) {
+
+		/* Sanity check: ensure we don't have connecting edges before splicing begins. */
+#ifdef DEBUG
+		{
+			struct TempVertPair *tvp = temp_vert_pairs.list;
+			do {
+				/* we must _never_ create connections here
+				 * (inface the islands can't have a connection at all) */
+				BLI_assert(BM_edge_exists(tvp->v_orig, tvp->v_temp) == NULL);
+			} while ((tvp = tvp->next));
+		}
+#endif
+
 		struct TempVertPair *tvp = temp_vert_pairs.list;
 		do {
-			/* we must _never_ create connections here
-			 * (inface the islands can't have a connection at all) */
-			BLI_assert(BM_edge_exists(tvp->v_orig, tvp->v_temp) == NULL);
-			BM_vert_splice(bm, tvp->v_orig, tvp->v_temp);
+			/* its _very_ unlikely the edge exists,
+			 * however splicing may case this. see: T48012 */
+			if (!BM_edge_exists(tvp->v_orig, tvp->v_temp)) {
+				BM_vert_splice(bm, tvp->v_orig, tvp->v_temp);
+			}
 		} while ((tvp = tvp->next));
 
 		/* Remove edges which have become doubles since splicing vertices together,




More information about the Bf-blender-cvs mailing list