Always free the main thread in RUBY_FREE_AT_EXIT

This commit is contained in:
Peter Zhu 2025-09-30 13:30:24 -04:00
parent 1f0da24049
commit c36c80bc25

6
vm.c
View File

@ -3343,10 +3343,8 @@ ruby_vm_destruct(rb_vm_t *vm)
rb_objspace_free_objects(objspace);
rb_free_generic_fields_tbl_();
rb_free_default_rand_key();
if (th && vm->fork_gen == 0) {
/* If we have forked, main_thread may not be the initial thread */
ruby_mimfree(th);
}
ruby_mimfree(th);
}
rb_objspace_free(objspace);
}