segfault using python bindings

David Bremner david at tethera.net
Sun Nov 18 15:34:22 PST 2018


Dirk Van Haerenborgh <dirk.vanhaerenborgh at senso2.me> writes:


> This is not a typo. I deliberately duplicated that bit.
> The second time it runs that loop, it will always segfault, unless you
> omit the first 'notmuch_message_destroy' call.
>
> Given your example, I suspect the Python3 bindings to do something very
> similar. I would think that this is the correct way to use the API?
>
> Kind regards,
> -Dirk

Unless I misremember / misunderstand something, calling
notmuch_message_destroy is not a good idea, unless you are going to
recreate the thread object. The thread has an internal list of messages,
which you are freeing.

Possibly the documentation could be improved on this point.

d


More information about the notmuch mailing list