FIX hang application, because SdrThread tries to auto-termitate itself

This commit is contained in:
vsonnier 2016-07-03 18:17:39 +02:00
parent 567d84711f
commit 5d1cb788e0
3 changed files with 3 additions and 11 deletions

View File

@ -298,6 +298,8 @@ int CubicSDR::OnExit() {
if (t_SDR) {
t_SDR->join();
delete t_SDR;
t_SDR = nullptr;
}
std::cout << "Terminating SDR post-processing thread.." << std::endl;
@ -444,11 +446,6 @@ void CubicSDR::sdrThreadNotify(SDRThread::SDRThreadState state, std::string mess
if (state == SDRThread::SDR_THREAD_MESSAGE) {
notifyMessage = message;
}
if (state == SDRThread::SDR_THREAD_TERMINATED) {
t_SDR->join();
delete t_SDR;
t_SDR = nullptr;
}
if (state == SDRThread::SDR_THREAD_FAILED) {
notifyMessage = message;
// wxMessageDialog *info;

View File

@ -378,11 +378,6 @@ void SDRThread::run() {
}
std::cout << "SDR thread done." << std::endl;
if (!stopping.load()) {
stopping.store(true);
wxGetApp().sdrThreadNotify(SDRThread::SDR_THREAD_TERMINATED, "Done.");
}
}

View File

@ -48,7 +48,7 @@ private:
public:
SDRThread();
~SDRThread();
enum SDRThreadState { SDR_THREAD_MESSAGE, SDR_THREAD_INITIALIZED, SDR_THREAD_TERMINATED, SDR_THREAD_FAILED };
enum SDRThreadState { SDR_THREAD_MESSAGE, SDR_THREAD_INITIALIZED, SDR_THREAD_FAILED };
virtual void run();