mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2026-02-10 23:20:54 +00:00
libsysprof-capture: fix leak of mapped ring buffer structure
This commit is contained in:
@ -335,6 +335,8 @@ mapped_ring_buffer_finalize (MappedRingBuffer *self)
|
|||||||
close (self->fd);
|
close (self->fd);
|
||||||
self->fd = -1;
|
self->fd = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
free (self);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|||||||
@ -163,6 +163,9 @@ test_threaded_movements (void)
|
|||||||
|
|
||||||
g_thread_join (thread1);
|
g_thread_join (thread1);
|
||||||
g_thread_join (thread2);
|
g_thread_join (thread2);
|
||||||
|
|
||||||
|
mapped_ring_buffer_unref (writer);
|
||||||
|
mapped_ring_buffer_unref (reader);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -183,6 +186,8 @@ test_readwrite (void)
|
|||||||
mapped_ring_buffer_advance (ring, sizeof *ptr);
|
mapped_ring_buffer_advance (ring, sizeof *ptr);
|
||||||
}
|
}
|
||||||
mapped_ring_buffer_drain (ring, drain_count_cb, NULL);
|
mapped_ring_buffer_drain (ring, drain_count_cb, NULL);
|
||||||
|
|
||||||
|
mapped_ring_buffer_unref (ring);
|
||||||
}
|
}
|
||||||
|
|
||||||
gint
|
gint
|
||||||
|
|||||||
Reference in New Issue
Block a user