From b0eae8a08e4965b9093b838a2d54da0e032cc178 Mon Sep 17 00:00:00 2001 From: Andre Medeiros Date: Mon, 21 Aug 2017 15:50:36 -0400 Subject: Mark error code details as global --- src/ruby/ext/grpc/rb_call.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/ruby/ext') diff --git a/src/ruby/ext/grpc/rb_call.c b/src/ruby/ext/grpc/rb_call.c index 74f189e1e0..5550bb7d5f 100644 --- a/src/ruby/ext/grpc/rb_call.c +++ b/src/ruby/ext/grpc/rb_call.c @@ -905,6 +905,9 @@ static void Init_grpc_error_codes() { rb_define_const(grpc_rb_mRpcErrors, "INVALID_FLAGS", UINT2NUM(GRPC_CALL_ERROR_INVALID_FLAGS)); + /* Hint the GC that this is a global and shouldn't be sweeped. */ + rb_global_variable(&rb_error_code_details); + /* Add the detail strings to a Hash */ rb_error_code_details = rb_hash_new(); rb_hash_aset(rb_error_code_details, UINT2NUM(GRPC_CALL_OK), -- cgit v1.2.3