python bindings memory management

python bindings memory management

Hi,

when writing this small script [0][1] using the notmuch python bindings I
had to manually delete the python objects in the right order. Otherwise
it segfaults when exiting, presumably because memory dependencies /
cleanup isn't done correctly when the Python GC gets going. Essentially
I have to delete the objects in the order of their dependency:

Re: python bindings memory management

> Hi,
>
> when writing this small script [0][1] using the notmuch python bindings I
> had to manually delete the python objects in the right order. Otherwise
> it segfaults when exiting, presumably because memory dependencies /
> cleanup isn't done correctly when the Python GC gets going. Essentially
> I have to delete the objects in the order of their dependency:

Re: python bindings memory management

David Bremner writes on november 20, 2017 0:11:

> Gaute Hope <[hidden email]> writes:
>
>> Hi,
>>
>> when writing this small script [0][1] using the notmuch python bindings I
>> had to manually delete the python objects in the right order. Otherwise
>> it segfaults when exiting, presumably because memory dependencies /
>> cleanup isn't done correctly when the Python GC gets going. Essentially
>> I have to delete the objects in the order of their dependency:
>
> Assuming this is python > 3.3, it sounds related to
>
> id:[hidden email]>
> See in particular
>
> id:[hidden email]