[Bf-python] data corruption

Ken Hughes khughes at pacific.edu
Thu Nov 17 19:47:48 CET 2005


Martin Poirier wrote:
> 
> --- "Gilbert, Joseph T." <jgilbert at tigr.ORG> wrote:
> 
> 
>>I am not sure if objects behave the same way as
>>other data. If an
>>armature data block has an id.us of 0 it's not freed
>>(because we set it
>>to zero manually when the object is created). Maybe
>>what's happening is
>>that when a user manually deletes an object from a
>>scene somewhere the
>>free() code for that object is called?
> 
> 
> Ken mentionned that in his previous mail, Objects and
> Scenes are the only two blender types which are
> automaticly freed from memory when their user count
> reaches zero.

Yeah, I assume it's free_libblock_us() which is being called, because it 
explicitly check for an object reading a use count of zero and deleting it.

> For all the others, BPY wouldn't *need* to increase
> the users on binding and decrease on destroy, but it
> would be safer nonetheless to do it, I think.

Ken



More information about the Bf-python mailing list