aboutsummaryrefslogtreecommitdiffstats
path: root/libshiboken
diff options
context:
space:
mode:
authorHugo Parente Lima <hugo.pl@gmail.com>2010-12-09 19:37:41 -0200
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-08 16:12:44 -0300
commitffd49b03b2677b297508457fdc94e98aaca5261a (patch)
treec63240be751fd793b301156692c28eef79c2f499 /libshiboken
parent627624f6b5bf1135cd97052baae52286e8e16024 (diff)
Fix bug#500 - "If an instance of QPrintDialog is created a deadlock happens on shutdown."
Reviewer: Lauro Mora <lauro.neto@openbossa.org> Marcelo Lira <marcelo.lira@openbossa.org>
Diffstat (limited to 'libshiboken')
-rw-r--r--libshiboken/basewrapper.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/libshiboken/basewrapper.cpp b/libshiboken/basewrapper.cpp
index 6c7d222ed..77f6cb719 100644
--- a/libshiboken/basewrapper.cpp
+++ b/libshiboken/basewrapper.cpp
@@ -30,6 +30,7 @@
#include <cstring>
#include <cstddef>
#include <algorithm>
+#include "threadstatesaver.h"
extern "C"
{
@@ -159,6 +160,8 @@ void SbkDeallocWrapper(PyObject* pyObj)
if (sbkObj->weakreflist)
PyObject_ClearWeakRefs(pyObj);
+ Shiboken::ThreadStateSaver threadSaver;
+ threadSaver.save();
// If I have ownership and is valid delete C++ pointer
if (sbkObj->d->hasOwnership && sbkObj->d->validCppObject) {
SbkObjectType* sbkType = reinterpret_cast<SbkObjectType*>(pyObj->ob_type);
@@ -169,8 +172,8 @@ void SbkDeallocWrapper(PyObject* pyObj)
sbkType->d->cpp_dtor(sbkObj->d->cptr[0]);
}
}
-
- Shiboken::Object::deallocData(sbkObj);
+ threadSaver.restore();
+ Shiboken::Object::deallocData(sbkObj, !sbkObj->d->containsCppWrapper);
}
void SbkDeallocWrapperWithPrivateDtor(PyObject* self)