[Bf-blender-cvs] [d0b037d] id-remap: Merge branch 'master' into id-remap

Bastien Montagne noreply at git.blender.org
Mon Dec 14 16:26:29 CET 2015


Commit: d0b037d0ef0d141bd8fe762ea76d2045b395b630
Author: Bastien Montagne
Date:   Mon Dec 14 16:26:14 2015 +0100
Branches: id-remap
https://developer.blender.org/rBd0b037d0ef0d141bd8fe762ea76d2045b395b630

Merge branch 'master' into id-remap

Conflicts:
	source/blender/blenkernel/intern/text.c
	source/blender/editors/space_outliner/outliner_edit.c
	source/blender/editors/space_outliner/outliner_tools.c

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



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

diff --cc source/blender/blenkernel/intern/text.c
index 3dce11e,cdc4855..620f7d5
--- a/source/blender/blenkernel/intern/text.c
+++ b/source/blender/blenkernel/intern/text.c
@@@ -152,25 -152,33 +152,36 @@@ static void init_undo_text(Text *text
  	text->undo_buf = MEM_mallocN(text->undo_len, "undo buf");
  }
  
+ /**
+  * \note caller must handle `undo_buf` and `compiled` members.
+  */
+ void BKE_text_free_lines(Text *text)
+ {
+ 	for (TextLine *tmp = text->lines.first, *tmp_next; tmp; tmp = tmp_next) {
+ 		tmp_next = tmp->next;
+ 		MEM_freeN(tmp->line);
+ 		if (tmp->format) {
+ 			MEM_freeN(tmp->format);
+ 		}
+ 		MEM_freeN(tmp);
+ 	}
+ 
+ 	BLI_listbase_clear(&text->lines);
+ 
+ 	text->curl = text->sell = NULL;
+ }
+ 
 +/** Free (or release) any data used by this text (does not free the text itself). */
  void BKE_text_free(Text *text)
  {
- 	TextLine *tmp;
- 
 +	/* No animdata here. */
 +
- 	for (tmp = text->lines.first; tmp; tmp = tmp->next) {
- 		MEM_freeN(tmp->line);
- 		if (tmp->format)
- 			MEM_freeN(tmp->format);
- 	}
- 	
- 	BLI_freelistN(&text->lines);
+ 	BKE_text_free_lines(text);
  
 -	if (text->name) MEM_freeN(text->name);
 -	MEM_freeN(text->undo_buf);
 +	MEM_SAFE_FREE(text->name);
 +	MEM_SAFE_FREE(text->undo_buf);
  #ifdef WITH_PYTHON
 -	if (text->compiled) BPY_text_free_code(text);
 +	BPY_text_free_code(text);
  #endif
  }




More information about the Bf-blender-cvs mailing list