File tree Expand file tree Collapse file tree 3 files changed +12
-2
lines changed Expand file tree Collapse file tree 3 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -64,6 +64,8 @@ void rb_thread_io_close_wait(struct rb_io *);
64
64
65
65
void rb_ec_check_ints (struct rb_execution_context_struct * ec );
66
66
67
+ void rb_thread_free_native_thread (void * th_ptr );
68
+
67
69
RUBY_SYMBOL_EXPORT_BEGIN
68
70
69
71
void * rb_thread_prevent_fork (void * (* func )(void * ), void * data ); /* for ext/socket/raddrinfo.c */
Original file line number Diff line number Diff line change @@ -529,6 +529,15 @@ thread_cleanup_func(void *th_ptr, int atfork)
529
529
rb_native_mutex_destroy (& th -> interrupt_lock );
530
530
}
531
531
532
+ void
533
+ rb_thread_free_native_thread (void * th_ptr )
534
+ {
535
+ rb_thread_t * th = th_ptr ;
536
+
537
+ native_thread_destroy_atfork (th -> nt );
538
+ th -> nt = NULL ;
539
+ }
540
+
532
541
static VALUE rb_threadptr_raise (rb_thread_t * , int , VALUE * );
533
542
static VALUE rb_thread_to_s (VALUE thread );
534
543
Original file line number Diff line number Diff line change @@ -3306,8 +3306,7 @@ ruby_vm_destruct(rb_vm_t *vm)
3306
3306
rb_id_table_free (vm -> constant_cache );
3307
3307
set_free_table (vm -> unused_block_warning_table );
3308
3308
3309
- xfree (th -> nt );
3310
- th -> nt = NULL ;
3309
+ rb_thread_free_native_thread (th );
3311
3310
3312
3311
#ifndef HAVE_SETPROCTITLE
3313
3312
ruby_free_proctitle ();
You can’t perform that action at this time.
0 commit comments