[svn:parrot] r49642 - branches/generational_gc/src/pmc

bacek at svn.parrot.org bacek at svn.parrot.org
Sun Oct 24 04:47:34 UTC 2010


Author: bacek
Date: Sun Oct 24 04:47:34 2010
New Revision: 49642
URL: https://trac.parrot.org/parrot/changeset/49642

Log:
Fix bad assumption in Scheduler.destroy.

Basically we can have such code:
$P0 = new 'Scheduler'
null $P0
sweep 1

Then we have NULL interp->scheduler.

Modified:
   branches/generational_gc/src/pmc/scheduler.pmc

Modified: branches/generational_gc/src/pmc/scheduler.pmc
==============================================================================
--- branches/generational_gc/src/pmc/scheduler.pmc	Sun Oct 24 04:11:33 2010	(r49641)
+++ branches/generational_gc/src/pmc/scheduler.pmc	Sun Oct 24 04:47:34 2010	(r49642)
@@ -251,7 +251,10 @@
 */
     VTABLE void destroy() {
         Parrot_Scheduler_attributes * const core_struct = PARROT_SCHEDULER(SELF);
-        core_struct->interp->scheduler = NULL;
+        /* If we are scheduler for this interpreter */
+        /* TOOD Should we allow creating of scheduler from PIR? */
+        if (core_struct->interp->scheduler == SELF)
+            core_struct->interp->scheduler = NULL;
         /* TT #946: this line is causing an order-of-destruction error
            because the scheduler is being freed before its tasks.
            Commenting this out till we get a real fix (although it's a hack) */


More information about the parrot-commits mailing list