From cf7c15e31a456f634d4e3deaf4ef74a6bfad825d Mon Sep 17 00:00:00 2001 From: Paul Yang Date: Fri, 8 Dec 2017 12:38:25 -0800 Subject: Fix ruby gc_test in ruby 2.4 (#4011) * Fix ruby gc_test in ruby 2.4 * Initialize global variables to Qnil. --- ruby/ext/google/protobuf_c/map.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ruby/ext/google/protobuf_c/map.c') diff --git a/ruby/ext/google/protobuf_c/map.c b/ruby/ext/google/protobuf_c/map.c index 26e22dc7..8c2f6424 100644 --- a/ruby/ext/google/protobuf_c/map.c +++ b/ruby/ext/google/protobuf_c/map.c @@ -825,8 +825,8 @@ VALUE Map_iter_value(Map_iter* iter) { void Map_register(VALUE module) { VALUE klass = rb_define_class_under(module, "Map", rb_cObject); rb_define_alloc_func(klass, Map_alloc); - cMap = klass; rb_gc_register_address(&cMap); + cMap = klass; rb_define_method(klass, "initialize", Map_init, -1); rb_define_method(klass, "each", Map_each, 0); -- cgit v1.2.3