shithub: aubio

Download patch

ref: 4b251ae94c0ea51c85f7ff121550129bda53dbab
parent: bfab39c54882678b2c52197cb10706c2bad841ac
author: Paul Brossier <piem@piem.org>
date: Tue Aug 30 12:33:31 EDT 2016

src/spectral/fft.c: make calls to fftw_destroy_plan thread-safe

--- a/src/spectral/fft.c
+++ b/src/spectral/fft.c
@@ -212,9 +212,11 @@
   /* destroy data */
   del_fvec(s->compspec);
 #ifdef HAVE_FFTW3             // using FFTW3
+  pthread_mutex_lock(&aubio_fftw_mutex);
   fftw_destroy_plan(s->pfw);
   fftw_destroy_plan(s->pbw);
   fftw_free(s->specdata);
+  pthread_mutex_unlock(&aubio_fftw_mutex);
 #else /* HAVE_FFTW3 */
 #ifdef HAVE_ACCELERATE        // using ACCELERATE
   AUBIO_FREE(s->spec.realp);