Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2009-02-01 17:24:44 +0300
committerCampbell Barton <ideasman42@gmail.com>2009-02-01 17:24:44 +0300
commit494575fabf83372cce0ae7e87dc4656d8fa82dee (patch)
tree793efdff6b7736688fc6b36bd2c483ecf21ea74f /source/blender/makesrna
parentdafc620a7514ff55dfd99cdea176447edef88e9e (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.c4
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: