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-14 14:29:10 -0200
commitb915f12df2349760309c2f7227bcdbad3c73a7da (patch)
treec5a2e4229aeb253f7ee036b252dd03f832812430
parent66bb59f9be9f7f38af48b1c4dc1108017c06ef72 (diff)
downloadshiboken-b915f12df2349760309c2f7227bcdbad3c73a7da.tar.gz
shiboken-b915f12df2349760309c2f7227bcdbad3c73a7da.tar.xz
shiboken-b915f12df2349760309c2f7227bcdbad3c73a7da.zip
Finally fix bug#500 - "If an instance of QPrintDialog is created a deadlock happens on shutdown."
Reviewer: Luciano Wolf <luciano.wolf@openbossa.org> Marcelo Lira <marcelo.lira@openbossa.org>
-rw-r--r--libshiboken/basewrapper.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/libshiboken/basewrapper.cpp b/libshiboken/basewrapper.cpp
index b3fc3801..72615dbb 100644
--- a/libshiboken/basewrapper.cpp
+++ b/libshiboken/basewrapper.cpp
@@ -30,6 +30,7 @@
#include <cstring>
#include <cstddef>
#include <algorithm>
+#include "threadstatesaver.h"
extern "C"
{
@@ -166,10 +167,11 @@ void SbkDeallocWrapper(PyObject* pyObj)
Shiboken::DtorCallerVisitor visitor(sbkObj);
Shiboken::walkThroughClassHierarchy(pyObj->ob_type, &visitor);
} else {
+ Shiboken::ThreadStateSaver threadSaver;
+ threadSaver.save();
sbkType->d->cpp_dtor(sbkObj->d->cptr[0]);
}
}
-
Shiboken::Object::deallocData(sbkObj, !sbkObj->d->containsCppWrapper);
}
@@ -317,6 +319,8 @@ bool importModule(const char* moduleName, PyTypeObject*** cppApiPtr)
void DtorCallerVisitor::visit(SbkObjectType* node)
{
+ Shiboken::ThreadStateSaver threadSaver;
+ threadSaver.save();
node->d->cpp_dtor(m_pyObj->d->cptr[m_count]);
m_count++;
}