diff --git a/gc.c b/gc.c index 2641115f90..9c7114e5a7 100644 --- a/gc.c +++ b/gc.c @@ -626,7 +626,7 @@ typedef struct gc_function_map { // Finalizers void (*make_zombie)(void *objspace_ptr, VALUE obj, void (*dfree)(void *), void *data); VALUE (*define_finalizer)(void *objspace_ptr, VALUE obj, VALUE block); - VALUE (*undefine_finalizer)(void *objspace_ptr, VALUE obj); + void (*undefine_finalizer)(void *objspace_ptr, VALUE obj); void (*copy_finalizer)(void *objspace_ptr, VALUE dest, VALUE obj); void (*shutdown_call_finalizer)(void *objspace_ptr); // Object ID @@ -1448,7 +1448,9 @@ os_each_obj(int argc, VALUE *argv, VALUE os) static VALUE undefine_final(VALUE os, VALUE obj) { - return rb_gc_impl_undefine_finalizer(rb_gc_get_objspace(), obj); + rb_gc_impl_undefine_finalizer(rb_gc_get_objspace(), obj); + + return obj; } static void diff --git a/gc/default.c b/gc/default.c index 59890d03be..e5662fc586 100644 --- a/gc/default.c +++ b/gc/default.c @@ -3001,7 +3001,7 @@ rb_gc_impl_define_finalizer(void *objspace_ptr, VALUE obj, VALUE block) return block; } -VALUE +void rb_gc_impl_undefine_finalizer(void *objspace_ptr, VALUE obj) { rb_objspace_t *objspace = objspace_ptr; @@ -3009,7 +3009,6 @@ rb_gc_impl_undefine_finalizer(void *objspace_ptr, VALUE obj) rb_check_frozen(obj); st_delete(finalizer_table, &data, 0); FL_UNSET(obj, FL_FINALIZE); - return obj; } VALUE diff --git a/gc/gc_impl.h b/gc/gc_impl.h index ab21e4e81b..18249dc58b 100644 --- a/gc/gc_impl.h +++ b/gc/gc_impl.h @@ -58,7 +58,7 @@ void rb_gc_impl_each_object(void *objspace_ptr, void (*func)(VALUE obj, void *da // Finalizers void rb_gc_impl_make_zombie(void *objspace_ptr, VALUE obj, void (*dfree)(void *), void *data); VALUE rb_gc_impl_define_finalizer(void *objspace_ptr, VALUE obj, VALUE block); -VALUE rb_gc_impl_undefine_finalizer(void *objspace_ptr, VALUE obj); +void rb_gc_impl_undefine_finalizer(void *objspace_ptr, VALUE obj); void rb_gc_impl_copy_finalizer(void *objspace_ptr, VALUE dest, VALUE obj); void rb_gc_impl_shutdown_call_finalizer(void *objspace_ptr); // Object ID