memory leak improvements - delete at end of scope

This commit is contained in:
William S Fulton 2016-06-26 00:06:01 +01:00
commit 7ec7cc63da

View file

@ -604,7 +604,6 @@ public:
Append(getFunctionWrapper->code, "return SWIG_OK;\n"); Append(getFunctionWrapper->code, "return SWIG_OK;\n");
Append(getFunctionWrapper->code, "}\n"); Append(getFunctionWrapper->code, "}\n");
Wrapper_print(getFunctionWrapper, wrappersSection); Wrapper_print(getFunctionWrapper, wrappersSection);
DelWrapper(getFunctionWrapper);
/* Add function to builder table */ /* Add function to builder table */
addFunctionToScilab(scilabGetFunctionName, getFunctionName); addFunctionToScilab(scilabGetFunctionName, getFunctionName);
@ -632,11 +631,13 @@ public:
Append(setFunctionWrapper->code, "return SWIG_OK;\n"); Append(setFunctionWrapper->code, "return SWIG_OK;\n");
Append(setFunctionWrapper->code, "}\n"); Append(setFunctionWrapper->code, "}\n");
Wrapper_print(setFunctionWrapper, wrappersSection); Wrapper_print(setFunctionWrapper, wrappersSection);
DelWrapper(setFunctionWrapper);
/* Add function to builder table */ /* Add function to builder table */
addFunctionToScilab(scilabSetFunctionName, setFunctionName); addFunctionToScilab(scilabSetFunctionName, setFunctionName);
DelWrapper(setFunctionWrapper);
} }
DelWrapper(getFunctionWrapper);
return SWIG_OK; return SWIG_OK;
} }