pygobject / pgi

[Unmaintained: Use PyGObject instead] GTK+ / GObject Introspection Bindings for PyPy.
GNU Lesser General Public License v2.1
74 stars 16 forks source link

Introduce Finalizers to avoid cycles #10

Closed pwaller closed 10 years ago

pwaller commented 10 years ago

As per #8, there was a leak due to cycles and the definition of a __del__ destructor. This instead uses weak proxies to be notified of deletion and invoke the correct destructor.

A new type, _BaseFinalizer is introduced, where one can override the destruction behaviour by defining destructor.

lazka commented 10 years ago

Sorry for the delay. Thanks for this.

btw. "./setup.py quality" will run pep8/pyflakes tests from https://github.com/lazka/pgi/tree/master/tests/misc

It can be a bit annoying, but it makes sure the code is tidy.