summaryrefslogtreecommitdiff
path: root/vm.c
diff options
context:
space:
mode:
Diffstat (limited to 'vm.c')
-rw-r--r--vm.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/vm.c b/vm.c
index f467055f92..130ca64160 100644
--- a/vm.c
+++ b/vm.c
@@ -1730,6 +1730,8 @@ thread_free(void *ptr)
#endif
ruby_xfree(ptr);
}
+ if (ruby_current_thread == th)
+ ruby_current_thread = NULL;
}
RUBY_FREE_LEAVE("thread");
}