Skip to content

Commit 67fee91

Browse files
committed
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.
1 parent 878be35 commit 67fee91

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

ruby/ext/google/protobuf_c/protobuf.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ static void Arena_mark(void *data) {
180180
static void Arena_free(void *data) {
181181
Arena *arena = data;
182182
upb_arena_free(arena->arena);
183+
xfree(arena);
183184
}
184185

185186
static VALUE cArena;

0 commit comments

Comments
 (0)