From 1d9b468db29c313d947b4454c2fb948ab2e26388 Mon Sep 17 00:00:00 2001 From: "dominique.leuenberger@gmail.com" Date: Wed, 14 Mar 2012 21:12:52 +0000 Subject: python bindings: guard the destructor. In case the app is shut down, the destructor might run too late. Fixes issue 176. git-svn-id: http://libproxy.googlecode.com/svn/trunk@838 c587cffe-e639-0410-9787-d7902ae8ed56 --- NEWS | 1 + bindings/python/libproxy.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index df48274..2e916d2 100644 --- a/NEWS +++ b/NEWS @@ -19,6 +19,7 @@ New in version 0.4.8 (not yet released) - #172: Allow to forcibly build pacrunner as module (-DBIPR={ON,OFF}) - #173: Libproxy doesn't build with gcc 4.7 - #147: Use ${CMAKE_DL_LIBS} instead of assuming libdl is correct. + - #176: python bindings: guard the destructor. New in version 0.4.7 ============================== diff --git a/bindings/python/libproxy.py b/bindings/python/libproxy.py index 563c2de..15f0210 100644 --- a/bindings/python/libproxy.py +++ b/bindings/python/libproxy.py @@ -121,5 +121,6 @@ class ProxyFactory(object): return proxies def __del__(self): - _libproxy.px_proxy_factory_free(self._pf) + if _libproxy: + _libproxy.px_proxy_factory_free(self._pf) -- cgit v1.2.1