aboutsummaryrefslogtreecommitdiffstats
path: root/generator
diff options
context:
space:
mode:
authorMarcelo Lira <marcelo.lira@openbossa.org>2011-05-11 18:15:40 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-08 16:15:22 -0300
commit587bac87604aadd4d7aedba2a911bfcac9671fe3 (patch)
treed47b703a57350790647875fd89f9f4709baf9fa1 /generator
parentbdd992a76956f86166256649f8bb3d42ce7439a2 (diff)
Replaced "isUserType" test for the correct "hasCppWrapper" before method calls.
Also added an unit test for infinite recursion when duck punching a virtual method. Reviewed by Hugo Parente <hugo.lima@openbossa.org> Reviewed by Renato Araújo <renato.filho@openbossa.org>
Diffstat (limited to 'generator')
-rw-r--r--generator/cppgenerator.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/generator/cppgenerator.cpp b/generator/cppgenerator.cpp
index 07b2111ed..dbc2a9456 100644
--- a/generator/cppgenerator.cpp
+++ b/generator/cppgenerator.cpp
@@ -2212,8 +2212,8 @@ void CppGenerator::writeMethodCall(QTextStream& s, const AbstractMetaFunction* f
virtualCall = virtualCall.replace("%CLASS_NAME", func->ownerClass()->qualifiedCppName());
normalCall = normalCall.replace("::%CLASS_NAME::", "");
methodCall = "";
- mc << "(Shiboken::Object::isUserType(self) ? ";
- mc << virtualCall << " : " << normalCall << ")";
+ mc << "Shiboken::Object::hasCppWrapper(reinterpret_cast<SbkObject*>(self)) ? ";
+ mc << virtualCall << " : " << normalCall;
}
}
}