forked from bartvdbraak/blender
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:
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,
|
||||||
|
Loading…
Reference in New Issue
Block a user