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)
commit15d4fe3c66b4bc1453f82c075634e325e3008162
treea8b7e156f4770441810c81e384545112eefcded2
parent6743ae7d80368d451ba9c4583ae826dc76af0061
Fix: free all the metadata-related memory

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>
formats/ctf/ctf.c
formats/ctf/metadata/ctf-ast.h
formats/ctf/metadata/ctf-parser.y
formats/ctf/metadata/ctf-visitor-generate-io-struct.c
types/sequence.c
types/struct.c
types/types.c
types/variant.c
This page took 0.032984 seconds and 4 git commands to generate.