Mercurial > hg > audiodb
annotate close.cpp @ 507:e7fd50483311
Free bits of the datum constructed in audioDB::query.
We're not quite safe: error calls between allocation of some of these
bits and pieces and their use will cause failure... but not freeing
things here is definitely wrong.
author | mas01cr |
---|---|
date | Tue, 13 Jan 2009 21:37:10 +0000 |
parents | 342822c2d49a |
children | cc2b97d020b1 |
rev | line source |
---|---|
mas01cr@498 | 1 #include "audioDB.h" |
mas01cr@498 | 2 extern "C" { |
mas01cr@498 | 3 #include "audioDB_API.h" |
mas01cr@498 | 4 #include "audioDB-internals.h" |
mas01cr@498 | 5 } |
mas01cr@498 | 6 |
mas01cr@498 | 7 void audiodb_close(adb_t *adb) { |
mas01cr@498 | 8 free(adb->path); |
mas01cr@498 | 9 free(adb->header); |
mas01cr@498 | 10 delete adb->keys; |
mas01cr@498 | 11 delete adb->keymap; |
mas01cr@498 | 12 delete adb->track_lengths; |
mas01cr@498 | 13 delete adb->track_offsets; |
mas01cr@498 | 14 if(adb->cached_lsh) { |
mas01cr@498 | 15 delete adb->cached_lsh; |
mas01cr@498 | 16 } |
mas01cr@498 | 17 close(adb->fd); |
mas01cr@498 | 18 free(adb); |
mas01cr@498 | 19 } |