Cage opened this issue on Dec 20, 2006 · 1232 posts
Spanki posted Tue, 08 April 2008 at 1:47 PM
No (not supposed to, at least)... when the script variable is freed (falls out of scope, or specifically deleted) - more specifically, when the reference count of the variable reaches zero - then Python calls my 'free' routine, where I decrement the reference counts I'm holding on the various arrays/data/members, then free the class/type structure.
If the script still has reference counts on any of those arrays/member elements, then they don't actually get freed (yet), but the class/type structure does.
In other words, it's supposed to all take care of itself. Each and every Python Object (whether it's an int, float, list, tuple, bool or .pyd implemented extension-type, etc) has it's own internal reference count. When (and only when) that reference count reaches zero, the Python interpreter calls that object's free routine.
The Python interpreter should be taking care of reference counts for everything the script is doing (re-assigning variables/pointers, tracking local vs global scoping, etc), so it should not be a concern for the script writer at all.
Cinema4D Plugins (Home of Riptide, Riptide Pro, Undertow, Morph Mill, KyamaSlide and I/Ogre plugins) Poser products Freelance Modelling, Poser Rigging, UV-mapping work for hire.