summaryrefslogtreecommitdiffstats
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>2010-12-13 11:32:28 -0200
commitfb90a3df97b53f3ef4878d8beb719d4aa7b0c6cb (patch)
tree34d6e0a96ca0b9d16b223f1e5875650512cf56eb
parent33537a0e9b0c3fc362032dec1820f08d248bed77 (diff)
downloadshiboken-fb90a3df97b53f3ef4878d8beb719d4aa7b0c6cb.tar.gz
shiboken-fb90a3df97b53f3ef4878d8beb719d4aa7b0c6cb.tar.xz
shiboken-fb90a3df97b53f3ef4878d8beb719d4aa7b0c6cb.zip
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>
-rw-r--r--libshiboken/basewrapper.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/libshiboken/basewrapper.cpp b/libshiboken/basewrapper.cpp
index b3fc3801..96a0f6f8 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,7 +172,7 @@ void SbkDeallocWrapper(PyObject* pyObj)
sbkType->d->cpp_dtor(sbkObj->d->cptr[0]);
}
}
-
+ threadSaver.restore();
Shiboken::Object::deallocData(sbkObj, !sbkObj->d->containsCppWrapper);
}