fix [#26967] separate mesh with p crashes blender

copying ID properties assumed each property was allocated separately which isnt the case for IDP_Arrays.
This commit is contained in:
Campbell Barton 2011-04-19 23:52:14 +00:00
parent be17466942
commit fde9ecbfbd

@ -78,9 +78,12 @@ IDProperty *IDP_NewIDPArray(const char *name)
IDProperty *IDP_CopyIDPArray(IDProperty *array) IDProperty *IDP_CopyIDPArray(IDProperty *array)
{ {
IDProperty *narray = MEM_dupallocN(array), *tmp; /* dont use MEM_dupallocN because this may be part of an array */
IDProperty *narray = MEM_mallocN(sizeof(IDProperty), "IDP_CopyIDPArray"), *tmp;
int i; int i;
*narray= *array;
narray->data.pointer = MEM_dupallocN(array->data.pointer); narray->data.pointer = MEM_dupallocN(array->data.pointer);
for (i=0; i<narray->len; i++) { for (i=0; i<narray->len; i++) {
/*ok, the copy functions always allocate a new structure, /*ok, the copy functions always allocate a new structure,