summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordominique.leuenberger@gmail.com <dominique.leuenberger@gmail.com@c587cffe-e639-0410-9787-d7902ae8ed56>2012-03-14 21:12:52 +0000
committerdominique.leuenberger@gmail.com <dominique.leuenberger@gmail.com@c587cffe-e639-0410-9787-d7902ae8ed56>2012-03-14 21:12:52 +0000
commit1d9b468db29c313d947b4454c2fb948ab2e26388 (patch)
tree517a4a2243d4d4e31825f0fb4be6289b0d9cea93
parenta6cb86a70344880cb788118199c5f84d41a80fbc (diff)
downloadlibproxy-1d9b468db29c313d947b4454c2fb948ab2e26388.tar.gz
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
-rw-r--r--NEWS1
-rw-r--r--bindings/python/libproxy.py3
2 files changed, 3 insertions, 1 deletions
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)