Fixed memory leak of Ruby arena objects.

In our free() method, we were freeing the memory from the
upb arena but we were failing to free the memory for the
Ruby arena object. This was causing every Ruby arena object
to leak: even though the objects were getting GC'd, the
underlying memory was not getting released.
pull/8461/head
Joshua Haberman 4 years ago
parent 878be3569e
commit 67fee915e0
  1. 1
      ruby/ext/google/protobuf_c/protobuf.c

@ -180,6 +180,7 @@ static void Arena_mark(void *data) {
static void Arena_free(void *data) { static void Arena_free(void *data) {
Arena *arena = data; Arena *arena = data;
upb_arena_free(arena->arena); upb_arena_free(arena->arena);
xfree(arena);
} }
static VALUE cArena; static VALUE cArena;

Loading…
Cancel
Save