aboutsummaryrefslogtreecommitdiff
path: root/src/fini.c
diff options
context:
space:
mode:
authorJamie Bullock <jamie@postlude.co.uk>2007-10-08 10:32:16 +0000
committerJamie Bullock <jamie@postlude.co.uk>2007-10-08 10:32:16 +0000
commit323fc04cb707d2a4b16e617279f2b82d86a9a2df (patch)
tree4d7a83c78dabf00c58c0639c410194e175ce6bd8 /src/fini.c
parent7044486fdcc4d806f46c35ec4787ae48fa26c369 (diff)
downloadLibXtract-323fc04cb707d2a4b16e617279f2b82d86a9a2df.tar.gz
LibXtract-323fc04cb707d2a4b16e617279f2b82d86a9a2df.tar.bz2
LibXtract-323fc04cb707d2a4b16e617279f2b82d86a9a2df.zip
Committed missing files needed for new out-of-place fftw plan creation
Diffstat (limited to 'src/fini.c')
-rw-r--r--src/fini.c48
1 files changed, 48 insertions, 0 deletions
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 <fftw3.h>
+#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
+}
+
+
+