aboutsummaryrefslogtreecommitdiffstats
path: root/generator
diff options
context:
space:
mode:
authorHugo Parente Lima <hugo.pl@gmail.com>2011-06-22 11:38:19 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-08 16:15:27 -0300
commit27c3af50e31bdafec37efe55fbcaccf3b1c49d02 (patch)
tree0e85b1f13e275e138d7ed71bbb4d74fe0e42d93b /generator
parent923ed37ea91de754e9c87d4d74f38283ebb1d257 (diff)
Dealloc Python object before calling the C++ destructor.
This will avoid the problem of having Python objects with ref count zero on binding manager while Python code using these objects can be triggered by the C++ object destruction. This commit makes DestroyListenner class unused in whole PySide project, probably it will be marked as deprecated in futher commits. Reviewer: Luciano Wolf <luciano.wolf@openbossa.org> Renato Araújo <renato.filho@openbossa.org>
Diffstat (limited to 'generator')
-rw-r--r--generator/cppgenerator.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/generator/cppgenerator.cpp b/generator/cppgenerator.cpp
index f4649213b..25c3db030 100644
--- a/generator/cppgenerator.cpp
+++ b/generator/cppgenerator.cpp
@@ -599,12 +599,8 @@ void CppGenerator::writeDestructorNative(QTextStream &s, const AbstractMetaClass
Indentation indentation(INDENT);
s << wrapperName(metaClass) << "::~" << wrapperName(metaClass) << "()" << endl << '{' << endl;
// kill pyobject
- if (usePySideExtensions() && metaClass->isQObject()) {
- s << INDENT << "PySide::DestroyListener::instance()->listen(this);" << endl;
- } else {
- s << INDENT << "SbkObject* wrapper = Shiboken::BindingManager::instance().retrieveWrapper(this);" << endl;
- s << INDENT << "Shiboken::Object::destroy(wrapper, this);" << endl;
- }
+ s << INDENT << "SbkObject* wrapper = Shiboken::BindingManager::instance().retrieveWrapper(this);" << endl;
+ s << INDENT << "Shiboken::Object::destroy(wrapper, this);" << endl;
s << '}' << endl;
}