Re: bug in ext_attributes or my xml file?




Am 17.06.2008 15:26, Avijit Ghosh schrieb:
I think I just figured it out. The way copy / paste works with instances
leads to this behavior. When you drag a new instance from the shape library
creates the new memory. However if you select / paste it seems to be copying
references to the data which accidentally glues them together. If you save
the file and then reload it the instances become separate so this is
obviously a bug.
Your analysis looks pretty valid and is consisten with the my interpretation of the code in objects/custom/custom_object.c(custom_copy),
specifically line 1651 ff:

  if (custom->info->ext_attr_size) /* copy ext area past end */
    memcpy (newcustom + 1, custom + 1, custom->info->ext_attr_size);

assumes every extended atrribute is stored by value, for strings it is just copying the pointer thus 'glueing' the values together. If these copied properties would be modified after the copy it should even crash ;(

> I can go in and fix this if it hasn't been fixed already.
Patches are appreciated, may it can be fixed by delegating part of custom_copy to object_copy_using_properties().

Even if you do not fix the issue please it with a complete enogh example to reproduce in bugzilla.

Thanks,
        Hans

-------- Hans "at" Breuer "dot" Org -----------
Tell me what you need, and I'll tell you how to
get along without it.                -- Dilbert



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]