Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't compile rb_undefine_finalizer on Ruby 3.4.0 and 3.4.1 #1239

Merged
merged 1 commit into from
Jan 18, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions optional/capi/ext/finalizer_spec.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,13 @@ static VALUE define_finalizer(VALUE self, VALUE obj, VALUE finalizer) {
}

static VALUE undefine_finalizer(VALUE self, VALUE obj) {
// Ruby 3.4.0 and 3.4.1 have a bug where rb_undefine_finalizer is missing
// See: https://bugs.ruby-lang.org/issues/20981
#if RUBY_API_VERSION_CODE == 30400 && (RUBY_VERSION_TEENY == 0 || RUBY_VERSION_TEENY == 1)
return Qnil;
#else
return rb_undefine_finalizer(obj);
#endif
}

void Init_finalizer_spec(void) {
Expand Down
Loading