diff --git a/src/libsysprof-capture/mapped-ring-buffer.c b/src/libsysprof-capture/mapped-ring-buffer.c index c7f2ce2c..ef55c1c1 100644 --- a/src/libsysprof-capture/mapped-ring-buffer.c +++ b/src/libsysprof-capture/mapped-ring-buffer.c @@ -335,6 +335,8 @@ mapped_ring_buffer_finalize (MappedRingBuffer *self) close (self->fd); self->fd = -1; } + + free (self); } void diff --git a/src/tests/test-mapped-ring-buffer.c b/src/tests/test-mapped-ring-buffer.c index 707c0dcb..444df156 100644 --- a/src/tests/test-mapped-ring-buffer.c +++ b/src/tests/test-mapped-ring-buffer.c @@ -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