Fixed memory leak of Ruby arena objects. (#8465)

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.

Co-authored-by: Joshua Haberman <jhaberman@gmail.com>
This commit is contained in:
Adam Cozzette 2021-04-07 16:46:18 -07:00 committed by GitHub
parent 7689f00ba8
commit e8b78f8208
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;