libsysprof-capture: fix leak of mapped ring buffer structure

This commit is contained in:
Christian Hergert
2023-05-12 14:02:46 -07:00
parent 8c17830522
commit dc99b46254
2 changed files with 7 additions and 0 deletions

View File

@ -335,6 +335,8 @@ mapped_ring_buffer_finalize (MappedRingBuffer *self)
close (self->fd);
self->fd = -1;
}
free (self);
}
void

View File

@ -163,6 +163,9 @@ test_threaded_movements (void)
g_thread_join (thread1);
g_thread_join (thread2);
mapped_ring_buffer_unref (writer);
mapped_ring_buffer_unref (reader);
}
static void
@ -183,6 +186,8 @@ test_readwrite (void)
mapped_ring_buffer_advance (ring, sizeof *ptr);
}
mapped_ring_buffer_drain (ring, drain_count_cb, NULL);
mapped_ring_buffer_unref (ring);
}
gint