Revision: 36229
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=36229
Author: campbellbarton
Date: 2011-04-19 23:52:14 +0000 (Tue, 19 Apr 2011)
Log Message:
-----------
fix [#26967] separate mesh with p crashes blender
copying ID properties assumed each property was allocated separately which isnt
the case for IDP_Arrays.
Modified Paths:
--------------
trunk/blender/source/blender/blenkernel/intern/idprop.c
Modified: trunk/blender/source/blender/blenkernel/intern/idprop.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/idprop.c 2011-04-19
16:30:55 UTC (rev 36228)
+++ trunk/blender/source/blender/blenkernel/intern/idprop.c 2011-04-19
23:52:14 UTC (rev 36229)
@@ -78,9 +78,12 @@
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;
-
+
+ *narray= *array;
+
narray->data.pointer = MEM_dupallocN(array->data.pointer);
for (i=0; i<narray->len; i++) {
/*ok, the copy functions always allocate a new structure,
_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs