Merge Richard Cohen's 'fix-memory-errors' into stable.

This commit is contained in:
John Ralls 2023-06-20 12:13:45 -07:00
commit 08d083e8e1
2 changed files with 3 additions and 9 deletions

View File

@ -74,7 +74,7 @@ GLIST_HELPER_INOUT(PriceList, SWIGTYPE_p_GNCPrice);
// TODO: free PriceList?
GLIST_HELPER_INOUT(CommodityList, SWIGTYPE_p_gnc_commodity);
%typemap(newfree) gchar * "g_free($1);"
%typemap(newfree) char * "g_free($1);"
/* These need to be here so that they are *before* the function
declarations in the header files, some of which are included by

View File

@ -280,11 +280,10 @@ update_variables (var_store_ptr vars)
}
}
static char* _function_evaluation_error_msg = NULL;
static void
_exception_handler(const char *error_message)
{
_function_evaluation_error_msg = (char*)error_message;
PERR("function eval error: [%s]\n", error_message);
}
static
@ -335,14 +334,9 @@ func_op(const char *fname, int argc, void **argv)
scmArgs = scm_cons( scmTmp, scmArgs );
}
//scmTmp = scm_apply(scmFn, scmArgs , SCM_EOL);
scmTmp = gfec_apply(scmFn, scmArgs, _exception_handler);
if (_function_evaluation_error_msg != NULL)
{
PERR("function eval error: [%s]\n", _function_evaluation_error_msg);
_function_evaluation_error_msg = NULL;
if (scmTmp == SCM_UNDEFINED)
return NULL;
}
if (!scm_is_number (scmTmp))
{