Home GnuPG
Diffusion GPGME ebfe2300c33a

python: Fix object deallocation.
ebfe2300c33aUnpublished

Unpublished Commit ยท Learn More

Not On Permanent Ref: This commit is not an ancestor of any permanent ref.

Description

python: Fix object deallocation.

Handing a reference to the wrapper object created a non-trivial
circular reference that Pythons garbage collector is unable to break.
Explicitly break it by using a weak reference.

  • lang/python/helpers.c (pygpgme_stash_callback_exception): Retrieve

object from weak reference.

  • lang/python/pyme/core.py (Context.del): Free status callback.

(Context.set_passphrase_cb): Use a weak reference.
(Context.set_progress_cb): Likewise.
(Context.set_status_cb): Likewise.
(Context.op_edit): Likewise.

  • Signed-off-by: Justus Winter <justus@gnupg.org>

Details

Provenance
justusAuthored on May 27 2016, 12:25 PM
Parents
rMe74cd9fb80f1: Improve comments.
Branches
Unknown
Tags
Unknown

Event Timeline

Justus Winter <justus@gnupg.org> committed rMebfe2300c33a: python: Fix object deallocation. (authored by Justus Winter <justus@gnupg.org>).May 27 2016, 12:25 PM