diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-02-01 17:24:44 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-02-01 17:24:44 +0300 |
commit | 494575fabf83372cce0ae7e87dc4656d8fa82dee (patch) | |
tree | 793efdff6b7736688fc6b36bd2c483ecf21ea74f /source/blender/makesrna | |
parent | dafc620a7514ff55dfd99cdea176447edef88e9e (diff) |
sculpt operator was setting default array value from stack variables that were then freed, making sculpt defaults use invalid memory.
Since these values defaulted to zero, a NULL default array will do, but for new operators that need to be initialized from an array, only static arrays should be used.
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/intern/rna_define.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/makesrna/intern/rna_define.c b/source/blender/makesrna/intern/rna_define.c index 292c3c3d201..da3bc584266 100644 --- a/source/blender/makesrna/intern/rna_define.c +++ b/source/blender/makesrna/intern/rna_define.c @@ -999,7 +999,7 @@ void RNA_def_property_float_default(PropertyRNA *prop, float value) break; } } - +/* array must remain valid after this function finishes */ void RNA_def_property_float_array_default(PropertyRNA *prop, const float *array) { StructRNA *srna= DefRNA.laststruct; @@ -1007,7 +1007,7 @@ void RNA_def_property_float_array_default(PropertyRNA *prop, const float *array) switch(prop->type) { case PROP_FLOAT: { FloatPropertyRNA *fprop= (FloatPropertyRNA*)prop; - fprop->defaultarray= array; + fprop->defaultarray= array; /* WARNING, this array must not come from the stack and lost */ break; } default: |