diff options
author | Hugo Parente Lima <hugo.lima@openbossa.org> | 2010-04-13 17:39:41 -0300 |
---|---|---|
committer | Hugo Parente Lima <hugo.lima@openbossa.org> | 2010-04-14 14:16:04 -0300 |
commit | f0f1aa01139a073430eb2c5feb767dedc45d3b4f (patch) | |
tree | a70e809848c08ac10be5f218894aa186d3279015 | |
parent | 22ca04e79698d7cd630134dab0e497ae4efa624e (diff) |
Fix memory leak when calling methods with some caracteristics.
To leak memory you need to call a method which the C++ version have one or more
argument passed as reference, so in python you pass a implicity convertible type.
E.g.: the method expects "const QString&" and you pass a Python string which will
be implicitly converted to a QString, the memory used by this implicitly generated
QString leaks.
Reviewer: Anderson Lizardo <anderson.lizardo@openbossa.org>
Reviewer: Luciano Wolf <luciano.wolf@openbossa.org>
-rw-r--r-- | cppgenerator.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/cppgenerator.cpp b/cppgenerator.cpp index 57e509da0..68222adbe 100644 --- a/cppgenerator.cpp +++ b/cppgenerator.cpp @@ -1194,7 +1194,7 @@ void CppGenerator::writeArgumentConversion(QTextStream& s, s << "Shiboken::Converter<" << typeName << " >::toCpp(" << pyArgName << ");" << endl; if (hasImplicitConversions) { - s << INDENT << "if (!" << cpythonCheckFunction(argType) << '(' << pyArgName << "))"; + s << INDENT << "if (!" << cpythonCheckFunction(argType->typeEntry()) << '(' << pyArgName << "))"; s << endl; Indentation indent(INDENT); s << INDENT << argName << "_auto_ptr = std::auto_ptr<" << baseTypeName; |