[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [20661] branches/blender2.5/blender/source /blender/makesrna/intern/rna_access.c: fix for printing operator collection values, also set some freed pointers to NULL

Campbell Barton ideasman42 at gmail.com
Fri Jun 5 21:43:33 CEST 2009


Revision: 20661
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=20661
Author:   campbellbarton
Date:     2009-06-05 21:43:33 +0200 (Fri, 05 Jun 2009)

Log Message:
-----------
fix for printing operator collection values, also set some freed pointers to NULL

Modified Paths:
--------------
    branches/blender2.5/blender/source/blender/makesrna/intern/rna_access.c

Modified: branches/blender2.5/blender/source/blender/makesrna/intern/rna_access.c
===================================================================
--- branches/blender2.5/blender/source/blender/makesrna/intern/rna_access.c	2009-06-05 19:22:23 UTC (rev 20660)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/rna_access.c	2009-06-05 19:43:33 UTC (rev 20661)
@@ -1505,6 +1505,7 @@
 void rna_iterator_listbase_end(CollectionPropertyIterator *iter)
 {
 	MEM_freeN(iter->internal);
+	iter->internal= NULL;
 }
 
 void rna_iterator_array_begin(CollectionPropertyIterator *iter, void *ptr, int itemsize, int length, IteratorSkipFunc skip)
@@ -1561,6 +1562,7 @@
 void rna_iterator_array_end(CollectionPropertyIterator *iter)
 {
 	MEM_freeN(iter->internal);
+	iter->internal= NULL;
 }
 
 /* RNA Path - Experiment */
@@ -2198,9 +2200,8 @@
 	BLI_dynstr_append(dynstr, "{");
 	
 	iterprop= RNA_struct_iterator_property(ptr->type);
-	RNA_property_collection_begin(ptr, iterprop, &iter);
 
-	for(; iter.valid; RNA_property_collection_next(&iter)) {
+	for(RNA_property_collection_begin(ptr, iterprop, &iter); iter.valid; RNA_property_collection_next(&iter)) {
 		prop= iter.ptr.data;
 		propname = RNA_property_identifier(prop);
 		
@@ -2211,7 +2212,7 @@
 			BLI_dynstr_append(dynstr, ", ");
 		first_time= 0;
 		
-		cstring = RNA_property_as_string(&iter.ptr, prop);
+		cstring = RNA_property_as_string(ptr, prop);
 		BLI_dynstr_appendf(dynstr, "\"%s\":%s", propname, cstring);
 		MEM_freeN(cstring);
 	}
@@ -2409,6 +2410,7 @@
 void RNA_parameter_list_free(ParameterList *parms)
 {
 	MEM_freeN(parms->data);
+	parms->data= NULL;
 
 	parms->func= NULL;
 





More information about the Bf-blender-cvs mailing list