Fix memory leak of getProxyName() return value
This is done not so much to fix the memory leak per se (as there are gazillions of other ones remaining), but to show that the return value of getProxyName() does need to be freed, as this was unclear previously, with it being freed in one place where this function was used, but not in the other one, here. Also state this explicitly in the function comment.
This commit is contained in:
parent
8f1b9dbbc5
commit
ba564d4e4e
1 changed files with 2 additions and 2 deletions
|
|
@ -169,8 +169,7 @@ public:
|
|||
* getProxyName()
|
||||
*
|
||||
* Test to see if a type corresponds to something wrapped with a proxy class.
|
||||
* Return NULL if not otherwise the proxy class name, fully qualified with
|
||||
* top level namespace name if the nspace feature is used.
|
||||
* Return NULL if not, otherwise the proxy class name to be freed by the caller.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
String *getProxyName(SwigType *t) {
|
||||
|
|
@ -205,6 +204,7 @@ public:
|
|||
}
|
||||
if (proxyname) {
|
||||
enumname = NewStringf("%s_%s", proxyname, symname);
|
||||
Delete(proxyname);
|
||||
} else {
|
||||
// global enum or enum in a namespace
|
||||
String *nspace = Getattr(n, "sym:nspace");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue