Skip to content

Commit

Permalink
Fixed memory leak of Ruby arena objects.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
haberman committed Apr 7, 2021
1 parent 878be35 commit 67fee91
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions ruby/ext/google/protobuf_c/protobuf.c
Expand Up @@ -180,6 +180,7 @@ static void Arena_mark(void *data) {
static void Arena_free(void *data) {
Arena *arena = data;
upb_arena_free(arena->arena);
xfree(arena);
}

static VALUE cArena;
Expand Down

0 comments on commit 67fee91

Please sign in to comment.