Fix: free all the metadata-related memory
authorJulien Desfossez <jdesfossez@efficios.com>
Tue, 16 Oct 2012 18:25:33 +0000 (14:25 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 16 Oct 2012 18:25:33 +0000 (14:25 -0400)
When opening a trace, the parser allocates various data structures to
represent internally the metadata.
This patch frees all this memory when a trace is closed.

When babeltrace was originally developed, it was meant to be mainly a
trace converter, so relying on the operating system to free memory was
"acceptable", although a bad practice. Now that libbabeltrace allows
reading the CTF format from an external application, it becomes clear
that fixing those memory leaks is required.

As of this commit, valgrind invoked in the following way on babeltrace
does not report any memory leak:
G_SLICE=always-malloc G_DEBUG=gc-friendly valgrind --leak-check=full

Let's keep it that way :-) !

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>

No differences found
This page took 0.0248930000000001 seconds and 4 git commands to generate.