aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRenato Filho <renato.filho@openbossa.org>2010-07-23 10:59:10 -0300
committerRenato Filho <renato.filho@openbossa.org>2010-07-23 15:40:01 -0300
commit2e827e65689b0bc0437c5bfffc6479151a774b31 (patch)
tree784e545a04f95bddc3c73bec64c7f40290f4b780
parent2194250dbb9d8863d70b90e167b4d3527ff832ed (diff)
Fixed memory leak.
Reviewer: Marcelo Lira <marcelo.lira@openbossa.org> Luciano Wolf <luciano.wolf@openbossa.org>
-rw-r--r--overloaddata.cpp2
-rw-r--r--shibokengenerator.cpp5
2 files changed, 5 insertions, 2 deletions
diff --git a/overloaddata.cpp b/overloaddata.cpp
index 36dcb9f43..1d81cab1b 100644
--- a/overloaddata.cpp
+++ b/overloaddata.cpp
@@ -126,7 +126,7 @@ void OverloadData::sortNextOverloads()
}
if (targetType->hasInstantiations()) {
- foreach(AbstractMetaType *instantiation, targetType->instantiations()) {
+ foreach(const AbstractMetaType *instantiation, targetType->instantiations()) {
if (map.contains(instantiation->typeEntry()->name())) {
int target = map[targetTypeEntry->name()];
int convertible = map[instantiation->typeEntry()->name()];
diff --git a/shibokengenerator.cpp b/shibokengenerator.cpp
index 6c50e7d19..f5349d299 100644
--- a/shibokengenerator.cpp
+++ b/shibokengenerator.cpp
@@ -814,14 +814,17 @@ QString ShibokenGenerator::guessCPythonCheckFunction(const QString& type)
{
QString retval;
AbstractMetaType* metaType = buildAbstractMetaTypeFromString(type);
- if (metaType) {
+ if (metaType && (metaType->name() != type)) {
retval = cpythonCheckFunction(metaType);
delete metaType;
+ metaType = 0;
} else if (type == "PyTypeObject") {
retval = "PyType_Check";
} else {
retval = QString("%1_Check").arg(type);
}
+ if(metaType)
+ delete metaType;
return retval;
}