From 27c3af50e31bdafec37efe55fbcaccf3b1c49d02 Mon Sep 17 00:00:00 2001 From: Hugo Parente Lima Date: Wed, 22 Jun 2011 11:38:19 -0300 Subject: Dealloc Python object before calling the C++ destructor. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Renato Araújo --- generator/cppgenerator.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'generator') 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; } -- cgit v1.2.3