From 323fc04cb707d2a4b16e617279f2b82d86a9a2df Mon Sep 17 00:00:00 2001 From: Jamie Bullock Date: Mon, 8 Oct 2007 10:32:16 +0000 Subject: Committed missing files needed for new out-of-place fftw plan creation --- src/fini.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 src/fini.c (limited to 'src/fini.c') diff --git a/src/fini.c b/src/fini.c new file mode 100644 index 0000000..3ec9133 --- /dev/null +++ b/src/fini.c @@ -0,0 +1,48 @@ +/* libxtract feature extraction library + * + * Copyright (C) 2006 Jamie Bullock + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, + * USA. + */ + +/* fini.c: Contains library destructor routine */ + +#ifdef XTRACT_FFT +#include +#include "xtract_globals_private.h" +#endif + +#ifdef __GNUC__ +__attribute__((destructor)) void fini() +#else +void _fini() +#endif +{ +#ifdef XTRACT_FFT + if(spectrum_plan != NULL) + fftwf_destroy_plan(spectrum_plan); + if(autocorrelation_fft_plan_1 != NULL) + fftwf_destroy_plan(autocorrelation_fft_plan_1); + if(autocorrelation_fft_plan_2 != NULL) + fftwf_destroy_plan(autocorrelation_fft_plan_2); + if(dct_plan != NULL) + fftwf_destroy_plan(dct_plan); + fftwf_cleanup(); +#endif +} + + + -- cgit v1.2.3