repair to `custodian-shutdown-all'

This appears to be an old bug where a check and use are misordered, so
I'm not sure why it hasn't caused more trouble before, but it depends
on a GC happening at the right time.

Closes PR 13245
This commit is contained in:
Matthew Flatt 2012-11-12 06:46:22 -07:00
parent a4d440a5e9
commit 483148e528

View File

@ -1301,7 +1301,7 @@ Scheme_Thread *scheme_do_close_managed(Scheme_Custodian *m, Scheme_Exit_Closer_F
f = m->closers[i]; f = m->closers[i];
data = m->data[i]; data = m->data[i];
if (!cf && (SAME_TYPE(SCHEME_TYPE(o), scheme_thread_hop_type))) { if (o && !cf && (SAME_TYPE(SCHEME_TYPE(o), scheme_thread_hop_type))) {
/* We've added an indirection and made it weak. See mr_hop note above. */ /* We've added an indirection and made it weak. See mr_hop note above. */
is_thread = 1; is_thread = 1;
the_thread = (Scheme_Thread *)WEAKIFIED(((Scheme_Thread_Custodian_Hop *)o)->p); the_thread = (Scheme_Thread *)WEAKIFIED(((Scheme_Thread_Custodian_Hop *)o)->p);