X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=blobdiff_plain;f=formats%2Fctf%2Fctf.c;h=d60b4353fc2c0d9bbdaaac45fbfb7e1475dd3b1d;hp=e59e3573b8709b6440e37f8560ca3dfe1e737298;hb=cd0058c96bdb3b32291f19899576978bb0fb6a19;hpb=15d4fe3c66b4bc1453f82c075634e325e3008162 diff --git a/formats/ctf/ctf.c b/formats/ctf/ctf.c index e59e3573..d60b4353 100644 --- a/formats/ctf/ctf.c +++ b/formats/ctf/ctf.c @@ -1911,6 +1911,7 @@ void ctf_close_trace(struct trace_descriptor *tdp) } } ctf_destroy_metadata(td); + close(td->dirfd); closedir(td->dir); g_free(td); } @@ -1935,6 +1936,7 @@ void ctf_set_handle(struct trace_descriptor *descriptor, td->handle = handle; } +static void __attribute__((constructor)) ctf_init(void) { int ret; @@ -1944,4 +1946,8 @@ void __attribute__((constructor)) ctf_init(void) assert(!ret); } -/* TODO: finalize */ +static +void __attribute__((destructor)) ctf_exit(void) +{ + bt_unregister_format(&ctf_format); +}