Mercurial > hg > audiodb
changeset 601:82d23418d867
Fix some fd leaks in the command-line binary
Strictly speaking, they're not really leaks, because the only codepath
that suffers from these leaks exits immediately afterwards. On the
other hand, this fix makes valgrind on e.g. tests/0025 happier, going
from 5 errors to none.
author | mas01cr |
---|---|
date | Fri, 14 Aug 2009 16:39:32 +0000 |
parents | 337e5962218a |
children | 783a1a5e51b2 |
files | audioDB.cpp |
diffstat | 1 files changed, 11 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/audioDB.cpp Thu Aug 13 11:20:56 2009 +0000 +++ b/audioDB.cpp Fri Aug 14 16:39:32 2009 +0000 @@ -149,8 +149,18 @@ delete reporter; if(rng) gsl_rng_free(rng); - if(infid>0) + if(infid>0) { close(infid); + infid = 0; + } + if(powerfd) { + close(powerfd); + powerfd = 0; + } + if(timesFile) { + delete timesFile; + timesFile = 0; + } if(adb) { audiodb_close(adb); adb = NULL;