diff --git a/bindings/engine.i b/bindings/engine.i index 186a0860a8..7e849af8bb 100644 --- a/bindings/engine.i +++ b/bindings/engine.i @@ -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 diff --git a/libgnucash/app-utils/gnc-exp-parser.c b/libgnucash/app-utils/gnc-exp-parser.c index dcb9cb80ed..ebca57a74a 100644 --- a/libgnucash/app-utils/gnc-exp-parser.c +++ b/libgnucash/app-utils/gnc-exp-parser.c @@ -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)) {