Fix memory leaks in Doxygen to PyDoc parameter types conversion code.
Don't forget to delete the local copy of parameter list and the temporary string.
This commit is contained in:
parent
b96dd8bb97
commit
3db8c1fca2
1 changed files with 7 additions and 3 deletions
|
|
@ -239,12 +239,16 @@ PyDocConverter::PyDocConverter(int flags) :
|
||||||
|
|
||||||
std::string PyDocConverter::getParamType(std::string param)
|
std::string PyDocConverter::getParamType(std::string param)
|
||||||
{
|
{
|
||||||
|
std::string type;
|
||||||
|
|
||||||
ParmList *plist = CopyParmList(Getattr(currentNode, "parms"));
|
ParmList *plist = CopyParmList(Getattr(currentNode, "parms"));
|
||||||
Parm *p = NULL;
|
Parm *p = NULL;
|
||||||
for (p = plist; p;) {
|
for (p = plist; p;) {
|
||||||
if (Char (Getattr(p, "name")) == param) {
|
if (Char (Getattr(p, "name")) == param) {
|
||||||
std::string type = Char (SwigType_str(Getattr(p, "type"), ""));
|
String *s = SwigType_str(Getattr(p, "type"), "");
|
||||||
return type;
|
type = Char (s);
|
||||||
|
Delete(s);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* doesn't seem to work always: in some cases (especially for 'self' parameters)
|
* doesn't seem to work always: in some cases (especially for 'self' parameters)
|
||||||
|
|
@ -254,7 +258,7 @@ std::string PyDocConverter::getParamType(std::string param)
|
||||||
p = nextSibling(p);
|
p = nextSibling(p);
|
||||||
}
|
}
|
||||||
Delete(plist);
|
Delete(plist);
|
||||||
return "";
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string PyDocConverter::justifyString(std::string documentString,
|
std::string PyDocConverter::justifyString(std::string documentString,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue