diff options
Diffstat (limited to 'ruby/ext/google/protobuf_c/defs.c')
-rw-r--r-- | ruby/ext/google/protobuf_c/defs.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/ruby/ext/google/protobuf_c/defs.c b/ruby/ext/google/protobuf_c/defs.c index 96ef4953..7e93bafb 100644 --- a/ruby/ext/google/protobuf_c/defs.c +++ b/ruby/ext/google/protobuf_c/defs.c @@ -255,6 +255,10 @@ void Descriptor_free(void* _self) { upb_handlers_unref(self->json_serialize_handlers, &self->json_serialize_handlers); } + if (self->json_serialize_handlers_preserve) { + upb_handlers_unref(self->json_serialize_handlers_preserve, + &self->json_serialize_handlers_preserve); + } xfree(self); } @@ -278,6 +282,7 @@ VALUE Descriptor_alloc(VALUE klass) { self->json_fill_method = NULL; self->pb_serialize_handlers = NULL; self->json_serialize_handlers = NULL; + self->json_serialize_handlers_preserve = NULL; self->typeclass_references = rb_ary_new(); return ret; } |