[vtkusers] When must I be weary of Python garbage collection?

Elvis Stansvik elvis.stansvik at orexplore.com
Wed Feb 24 09:16:39 EST 2016


2016-02-24 15:04 GMT+01:00 David Gobbi <david.gobbi at gmail.com>:

> On Wed, Feb 24, 2016 at 6:51 AM, Elvis Stansvik <
> elvis.stansvik at orexplore.com> wrote:
>
>> 2016-02-24 14:38 GMT+01:00 David Gobbi <david.gobbi at gmail.com>:
>>>
>>> Because garbage collection is done via reference counting, sometimes gc
>>> is delayed due to reference cycles.  But both VTK and Python have cycle
>>> detection in their garbage collectors.
>>>
>>
>> Ah yes, I remember reading that observers can give rise to reference
>> cycles.
>>
>
> Weakrefs can be used to avoid reference cycles in some situations.
>

Alright. Pretty sure I don't have any cycles at the moment, but good to
know.

Elvis


>
>  - David
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160224/9a517dd0/attachment.html>


More information about the vtkusers mailing list