[svn:parrot] r39466 - trunk/src/pmc

chromatic at svn.parrot.org chromatic at svn.parrot.org
Tue Jun 9 08:23:00 UTC 2009


Author: chromatic
Date: Tue Jun  9 08:22:59 2009
New Revision: 39466
URL: https://trac.parrot.org/parrot/changeset/39466

Log:
[PMC] Plugged a memory leak in the Coroutine PMC, where it didn't set a
reference to the allocated context.  Parrot_free_context() doesn't recycle
contexts if their ref counts are negative to avoid crashes, but this meant that
when it was time to recycle this context, it didn't get reclaimed.

Modified:
   trunk/src/pmc/coroutine.pmc

Modified: trunk/src/pmc/coroutine.pmc
==============================================================================
--- trunk/src/pmc/coroutine.pmc	Tue Jun  9 08:01:08 2009	(r39465)
+++ trunk/src/pmc/coroutine.pmc	Tue Jun  9 08:22:59 2009	(r39466)
@@ -149,7 +149,7 @@
             caller_ctx = CONTEXT(interp);
             ctx        = Parrot_set_new_context(INTERP, co->n_regs_used);
 
-            co->ctx                   = ctx;
+            co->ctx                   = Parrot_context_ref(interp, ctx);
             co->dynamic_state         = interp->dynamic_env;
 
             ctx->caller_ctx           = caller_ctx;


More information about the parrot-commits mailing list