mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2026-06-06 16:05:09 -04:00
Automatic FFTW3 wisdom handling for map65 GUI and shmem m65 runs
This commit is contained in:
+21
-1
@@ -1,3 +1,4 @@
|
||||
#include <fftw3.h>
|
||||
#ifdef QT5
|
||||
#include <QtWidgets>
|
||||
#else
|
||||
@@ -8,6 +9,11 @@
|
||||
#include "revision_utils.hpp"
|
||||
#include "mainwindow.h"
|
||||
|
||||
extern "C" {
|
||||
// Fortran procedures we need
|
||||
void four2a_ (_Complex float *, int * nfft, int * ndim, int * isign, int * iform, int len);
|
||||
}
|
||||
|
||||
static QtMessageHandler default_message_handler;
|
||||
|
||||
void my_message_handler (QtMsgType type, QMessageLogContext const& context, QString const& msg)
|
||||
@@ -28,5 +34,19 @@ int main(int argc, char *argv[])
|
||||
a.setApplicationVersion ("3.0.0-devel");
|
||||
MainWindow w;
|
||||
w.show ();
|
||||
return a.exec ();
|
||||
auto result = a.exec ();
|
||||
|
||||
// clean up lazily initialized FFTW3 resources
|
||||
{
|
||||
int nfft {-1};
|
||||
int ndim {1};
|
||||
int isign {1};
|
||||
int iform {1};
|
||||
// free FFT plan resources
|
||||
four2a_ (nullptr, &nfft, &ndim, &isign, &iform, 0);
|
||||
}
|
||||
fftwf_forget_wisdom ();
|
||||
fftwf_cleanup ();
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user