[Kde-bindings] KDE/kdebindings/generator/generators/smoke
Arno Rehn
kde at arnorehn.de
Tue Jul 6 11:44:10 UTC 2010
SVN commit 1146692 by arnorehn:
Only add the __internal__SmokeClass heritage if the class actually has a virtual
destructor and as such is supposed to be subclassed. Fixes a bunch of crashes with
classes without a vtable.
CCMAIL: kde-bindings at kde.org
M +5 -2 writeClasses.cpp
--- trunk/KDE/kdebindings/generator/generators/smoke/writeClasses.cpp #1146691:1146692
@@ -80,7 +80,7 @@
fileOut << "\n#include <smoke.h>\n#include <" << Options::module << "_smoke.h>\n";
- fileOut << "\nclass __internal_SmokeClass { public: virtual ~__internal_SmokeClass() {} };\n";
+ fileOut << "\nclass __internal_SmokeClass {};\n";
fileOut << "\nnamespace __smoke" << Options::module << " {\n\n";
@@ -366,8 +366,11 @@
out << QString("class %1").arg(smokeClassName);
if (!klass->isNameSpace()) {
- out << QString(" : public %1, public __internal_SmokeClass").arg(className);
+ out << QString(" : public %1").arg(className);
+ if (Util::hasClassVirtualDestructor(klass) && Util::hasClassPublicDestructor(klass)) {
+ out << ", public __internal_SmokeClass";
}
+ }
out << " {\n";
if (Util::canClassBeInstanciated(klass)) {
out << " SmokeBinding* _binding;\n";
More information about the Kde-bindings
mailing list