# HG changeset patch # User John W. Eaton # Date 1323063051 18000 # Node ID 99f039289e95a40ca125f534eae739e1cb8f4413 # Parent e58963b5c0b11d02febc7194d945e3398fc04f18 also clean up float fftw planner * oct-fftw.h (octave_float_fftw_planner::cleanup_instance): New function. * oct-fftw.cc (octave_float_fftw_planner::instance_ok): Add instance to singleton cleanup list. diff -r e58963b5c0b1 -r 99f039289e95 liboctave/oct-fftw.cc --- a/liboctave/oct-fftw.cc Sun Dec 04 19:37:58 2011 -0500 +++ b/liboctave/oct-fftw.cc Mon Dec 05 00:30:51 2011 -0500 @@ -389,7 +389,12 @@ bool retval = true; if (! instance) - instance = new octave_float_fftw_planner (); + { + instance = new octave_float_fftw_planner (); + + if (instance) + singleton_cleanup_list::add (cleanup_instance); + } if (! instance) { diff -r e58963b5c0b1 -r 99f039289e95 liboctave/oct-fftw.h --- a/liboctave/oct-fftw.h Sun Dec 04 19:37:58 2011 -0500 +++ b/liboctave/oct-fftw.h Mon Dec 05 00:30:51 2011 -0500 @@ -245,6 +245,8 @@ static octave_float_fftw_planner *instance; + static void cleanup_instance (void) { delete instance; instance = 0; } + fftwf_plan do_create_plan (int dir, const int rank, const dim_vector dims, octave_idx_type howmany, octave_idx_type stride,