aboutsummaryrefslogtreecommitdiffstats
path: root/libpyside
diff options
context:
space:
mode:
authorJohn Ehresman <jpe@wingware.com>2013-06-29 13:42:41 -0500
committerJohn Cummings <jcummings2@users.sf.net>2013-07-01 17:00:44 +0200
commited4751735b341a771e88ece21e2a98301cabe313 (patch)
treee3b8ae9fa90115c8bc03830b338fafe0d813c449 /libpyside
parent3683caf30ca60b273070d9f7e50cf2c2efc7e110 (diff)
Fix potential segfault at shutdown
Check Py_IsInitialized() in PyObjectWrapper destructor, which can be called after interpreter shutdown Change-Id: If9570d14a35ac3419a81846a59d972015205a858 Reviewed-by: John Cummings <jcummings2@users.sf.net>
Diffstat (limited to 'libpyside')
-rw-r--r--libpyside/signalmanager.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/libpyside/signalmanager.cpp b/libpyside/signalmanager.cpp
index 76ed72500..ac1a00e7f 100644
--- a/libpyside/signalmanager.cpp
+++ b/libpyside/signalmanager.cpp
@@ -104,6 +104,11 @@ PyObjectWrapper::PyObjectWrapper(const PyObjectWrapper &other)
PyObjectWrapper::~PyObjectWrapper()
{
+ // Check that Python is still initialized as sometimes this is called by a static destructor
+ // after Python interpeter is shutdown.
+ if (!Py_IsInitialized())
+ return;
+
Shiboken::GilState gil;
Py_DECREF(m_me);
}