mirror of
https://github.com/TomHarte/CLK.git
synced 2025-08-07 23:25:00 +00:00
Makes more failing attempts at a clean shutdown.
This commit is contained in:
@@ -25,8 +25,9 @@ class FunctionThread: public QThread {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void stop() {
|
void stop() {
|
||||||
QMetaObject::invokeMethod(this, "quit", Qt::QueuedConnection);
|
// QMetaObject::invokeMethod(this, "quit", Qt::QueuedConnection);
|
||||||
while(isRunning());
|
quit();
|
||||||
|
wait();
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@@ -65,7 +65,7 @@ void MainWindow::open() {
|
|||||||
MainWindow::~MainWindow() {
|
MainWindow::~MainWindow() {
|
||||||
// Stop the audio output, and its thread.
|
// Stop the audio output, and its thread.
|
||||||
if(audioOutput) {
|
if(audioOutput) {
|
||||||
audioOutput->stop();
|
// QMetaObject::invokeMethod(audioOutput.get(), "stop", Qt::BlockingQueuedConnection);
|
||||||
audioThread.stop();
|
audioThread.stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -13,7 +13,7 @@ Timer::Timer(QObject *parent) : QObject(parent) {
|
|||||||
timer = std::make_unique<QTimer>();
|
timer = std::make_unique<QTimer>();
|
||||||
timer->setInterval(1);
|
timer->setInterval(1);
|
||||||
|
|
||||||
connect(timer.get(), SIGNAL(timeout()), this, SLOT(tick()), Qt::DirectConnection);
|
connect(timer.get(), &QTimer::timeout, this, &Timer::tick, Qt::DirectConnection);
|
||||||
timer->start();
|
timer->start();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -35,6 +35,6 @@ void Timer::tick() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Timer::~Timer() {
|
Timer::~Timer() {
|
||||||
QMetaObject::invokeMethod(timer.get(), "stop", Qt::QueuedConnection);
|
QMetaObject::invokeMethod(timer.get(), "stop", Qt::BlockingQueuedConnection);
|
||||||
thread.stop();
|
thread.stop();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user