Mercurial > hg > audiodb
view power.cpp @ 445:d1771f436ff7 api-inversion
Better memory discipline
Use new rather than malloc()/calloc() for the qpointery bits of memory
that audioDB::query_loop ends up calling delete [] on.
We're still leaking memory in various places, but at least we're not
massively undefined...
author | mas01cr |
---|---|
date | Wed, 24 Dec 2008 10:56:41 +0000 |
parents | 7038f31124d1 |
children |
line wrap: on
line source
#include "audioDB.h" extern "C" { #include "audioDB_API.h" #include "audioDB-internals.h" } int audiodb_power(adb_t *adb) { if(!(adb->flags & O_RDWR)) { return 1; } if(adb->header->length > 0) { return 1; } adb->header->flags |= O2_FLAG_POWER; return audiodb_sync_header(adb); }