summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcelo Lira <marcelo.lira@openbossa.org>2010-05-28 10:33:41 -0300
committerMarcelo Lira <marcelo.lira@openbossa.org>2010-05-31 09:44:29 -0300
commita7ff3eba6db91b02b64fd3eb188c78c66b282c0b (patch)
tree3ab9997b47a9e1c4cd2474f731bc29bafa22f9bc
parent28dc75fbf711f90ea96c0f0cbef21bc9fe2f0ab0 (diff)
downloadshiboken-a7ff3eba6db91b02b64fd3eb188c78c66b282c0b.tar.gz
shiboken-a7ff3eba6db91b02b64fd3eb188c78c66b282c0b.tar.xz
shiboken-a7ff3eba6db91b02b64fd3eb188c78c66b282c0b.zip
Fixes generation of classes with protected virtual destructors.
The problem appears when the binding is generated without the protected hack.
-rw-r--r--cppgenerator.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/cppgenerator.cpp b/cppgenerator.cpp
index 1bd6d692..2d30be2c 100644
--- a/cppgenerator.cpp
+++ b/cppgenerator.cpp
@@ -1882,7 +1882,13 @@ void CppGenerator::writeClassDefinition(QTextStream& s, const AbstractMetaClass*
else
deallocClassName = cppClassName;
tp_dealloc = "&Shiboken::deallocWrapper";
- cpp_dtor = "&Shiboken::callCppDestructor<" + metaClass->qualifiedCppName() + " >";
+
+ QString dtorClassName = metaClass->qualifiedCppName();
+#ifdef AVOID_PROTECTED_HACK
+ if (metaClass->hasProtectedDestructor())
+ dtorClassName = wrapperName(metaClass);
+#endif
+ cpp_dtor = "&Shiboken::callCppDestructor<" + dtorClassName + " >";
tp_init = onlyPrivCtor ? "0" : cpythonFunctionName(ctors.first());
}