[Bf-blender-cvs] [62429406391] master: Fix double free in dyntopo-sculpt mode undo

Campbell Barton noreply at git.blender.org
Thu Jun 7 14:54:34 CEST 2018


Commit: 624294063910ad3c6459702a7e6aac592db3a720
Author: Campbell Barton
Date:   Thu Jun 7 14:54:09 2018 +0200
Branches: master
https://developer.blender.org/rB624294063910ad3c6459702a7e6aac592db3a720

Fix double free in dyntopo-sculpt mode undo

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

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

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

diff --git a/source/blender/bmesh/intern/bmesh_log.c b/source/blender/bmesh/intern/bmesh_log.c
index 4e6fff03411..30ab0dd9459 100644
--- a/source/blender/bmesh/intern/bmesh_log.c
+++ b/source/blender/bmesh/intern/bmesh_log.c
@@ -654,17 +654,21 @@ void BM_log_mesh_elems_reorder(BMesh *bm, BMLog *log)
  */
 BMLogEntry *BM_log_entry_add(BMLog *log)
 {
-	BMLogEntry *entry, *next;
-
+	/* WARNING: this is now handled by the UndoSystem: BKE_UNDOSYS_TYPE_SCULPT
+	 * freeing here causes unnecesssary complications. */
+	BMLogEntry *entry;
+#if 0
 	/* Delete any entries after the current one */
 	entry = log->current_entry;
 	if (entry) {
+		BMLogEntry *next;
 		for (entry = entry->next; entry; entry = next) {
 			next = entry->next;
 			bm_log_entry_free(entry);
 			BLI_freelinkN(&log->entries, entry);
 		}
 	}
+#endif
 
 	/* Create and append the new entry */
 	entry = bm_log_entry_create();



More information about the Bf-blender-cvs mailing list