WSJT-X/map65/main.cpp
Bill Somerville cc24068106
Graceful shutdown of MAP65
May wait for current decoding cycle to complete.
2021-05-17 22:18:52 +01:00

42 lines
935 B
C++

#include <fftw3.h>
#ifdef QT5
#include <QtWidgets>
#else
#include <QtGui>
#endif
#include <QApplication>
#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);
}
int main(int argc, char *argv[])
{
QApplication a {argc, argv};
// Override programs executable basename as application name.
a.setApplicationName ("MAP65");
a.setApplicationVersion ("3.0.0-devel");
MainWindow w;
w.show ();
QObject::connect (&a, &QApplication::lastWindowClosed, &a, &QApplication::quit);
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;
}