fix warning about non-initialized result, and add missing deletes
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@7752 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
5a94a4c385
commit
1ac74dac03
1 changed files with 7 additions and 3 deletions
|
|
@ -38,14 +38,18 @@ void emit_args(SwigType *rt, ParmList *l, Wrapper *f) {
|
|||
if (rt && (SwigType_type(rt) != T_VOID)) {
|
||||
SwigType *vt = cplus_value_type(rt);
|
||||
SwigType *tt = vt ? vt : rt;
|
||||
if (SwigType_ispointer(tt)) {
|
||||
Wrapper_add_localv(f,"result", SwigType_lstr(tt,"result"), "= 0", NULL);
|
||||
SwigType *lt = SwigType_ltype(tt);
|
||||
String *lstr = SwigType_str(lt,"result");
|
||||
if (SwigType_ispointer(lt)) {
|
||||
Wrapper_add_localv(f,"result", lstr, "= 0", NULL);
|
||||
} else{
|
||||
Wrapper_add_local(f,"result", SwigType_lstr(tt,"result"));
|
||||
Wrapper_add_local(f,"result", lstr);
|
||||
}
|
||||
if (vt) {
|
||||
Delete(vt);
|
||||
}
|
||||
Delete(lt);
|
||||
Delete(lstr);
|
||||
}
|
||||
|
||||
/* Attach typemaps to parameters */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue