[svn:parrot] r45183 - trunk/src
chromatic at svn.parrot.org
chromatic at svn.parrot.org
Thu Mar 25 18:55:09 UTC 2010
Author: chromatic
Date: Thu Mar 25 18:55:07 2010
New Revision: 45183
URL: https://trac.parrot.org/parrot/changeset/45183
Log:
[mmd] Fixed still another Parrot_pcc_split_signature_string() memory leak.
Modified:
trunk/src/multidispatch.c
Modified: trunk/src/multidispatch.c
==============================================================================
--- trunk/src/multidispatch.c Thu Mar 25 17:54:18 2010 (r45182)
+++ trunk/src/multidispatch.c Thu Mar 25 18:55:07 2010 (r45183)
@@ -272,6 +272,8 @@
va_start(args, sig);
call_obj = Parrot_pcc_build_call_from_varargs(interp, PMCNULL, arg_sig, &args);
+ mem_gc_free(interp, arg_sig);
+
/* Check the cache. */
sub = Parrot_mmd_cache_lookup_by_types(interp, interp->op_mmd_cache, name,
VTABLE_get_pmc(interp, call_obj));
@@ -285,10 +287,12 @@
VTABLE_get_pmc(interp, call_obj), sub);
}
- if (PMC_IS_NULL(sub))
+ if (PMC_IS_NULL(sub)) {
+ mem_gc_free(interp, ret_sig);
Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_METHOD_NOT_FOUND,
"Multiple Dispatch: No suitable candidate found for '%s',"
" with signature '%s'", name, sig);
+ }
#if MMD_DEBUG
Parrot_io_eprintf(interp, "candidate found for '%s', with signature '%s'\n",
@@ -301,6 +305,7 @@
call_obj = Parrot_pcc_get_signature(interp, CURRENT_CONTEXT(interp));
Parrot_pcc_fill_params_from_varargs(interp, call_obj, ret_sig, &args,
PARROT_ERRORS_RESULT_COUNT_FLAG);
+ mem_gc_free(interp, ret_sig);
va_end(args);
}
More information about the parrot-commits
mailing list