From: Julien Desfossez Date: Tue, 16 Oct 2012 18:25:33 +0000 (-0400) Subject: Fix: free all the metadata-related memory X-Git-Tag: v1.0.0-rc6~11 X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=commitdiff_plain;h=15d4fe3c66b4bc1453f82c075634e325e3008162;hp=15d4fe3c66b4bc1453f82c075634e325e3008162 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 Signed-off-by: Mathieu Desnoyers ---