From 587bac87604aadd4d7aedba2a911bfcac9671fe3 Mon Sep 17 00:00:00 2001 From: Marcelo Lira Date: Wed, 11 May 2011 18:15:40 -0300 Subject: Replaced "isUserType" test for the correct "hasCppWrapper" before method calls. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Also added an unit test for infinite recursion when duck punching a virtual method. Reviewed by Hugo Parente Reviewed by Renato Araújo --- generator/cppgenerator.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'generator') 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(self)) ? "; + mc << virtualCall << " : " << normalCall; } } } -- cgit v1.2.3