From 483148e528ecfab707617c8ffabd71643d08a58b Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Mon, 12 Nov 2012 06:46:22 -0700 Subject: [PATCH] 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 --- src/racket/src/thread.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/racket/src/thread.c b/src/racket/src/thread.c index 328d87b032..18506a5c99 100644 --- a/src/racket/src/thread.c +++ b/src/racket/src/thread.c @@ -1301,7 +1301,7 @@ Scheme_Thread *scheme_do_close_managed(Scheme_Custodian *m, Scheme_Exit_Closer_F f = m->closers[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. */ is_thread = 1; the_thread = (Scheme_Thread *)WEAKIFIED(((Scheme_Thread_Custodian_Hop *)o)->p);