view close.cpp @ 472:0f96ad351990 api-inversion

Clean up some compiler warnings. Yes, we must check return values from read(2). Make audiodb_track_id_datum() be more paranoid, and audiodb_free_datum() defend against potential double-frees as well (even though we're not exposing that issue at this point).
author mas01cr
date Tue, 06 Jan 2009 15:25:39 +0000
parents 1030664df98c
children
line wrap: on
line source
#include "audioDB.h"
extern "C" {
#include "audioDB_API.h"
#include "audioDB-internals.h"
}

void audiodb_close(adb_t *adb) {
  free(adb->path);
  free(adb->header);
  delete adb->keys;
  delete adb->keymap;
  delete adb->track_lengths;
  delete adb->track_offsets;
  if(adb->cached_lsh) {
    delete adb->cached_lsh;
  }
  close(adb->fd);
  free(adb);
}