Thread interruption
This commit is contained in:
@@ -43,7 +43,7 @@ EmuThread::EmuThread(const std::shared_ptr<QtInstanceFactory> &instance_,
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
while (true) {
|
while (!isInterruptionRequested()) {
|
||||||
if (!core.pause) {
|
if (!core.pause) {
|
||||||
core.Run(settings.getVolumeL(), settings.getVolumeR());
|
core.Run(settings.getVolumeL(), settings.getVolumeR());
|
||||||
if (core.render) {
|
if (core.render) {
|
||||||
@@ -108,4 +108,7 @@ EmuThread::EmuThread(const std::shared_ptr<QtInstanceFactory> &instance_,
|
|||||||
pif.UpdateAxis(0, n64::Controller::Axis::X, xclamped);
|
pif.UpdateAxis(0, n64::Controller::Axis::X, xclamped);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SetRender(false);
|
||||||
|
Stop();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,9 +60,9 @@ void KaizenQt::LoadROM(const QString &fileName) noexcept {
|
|||||||
|
|
||||||
void KaizenQt::Quit() noexcept {
|
void KaizenQt::Quit() noexcept {
|
||||||
if (emuThread) {
|
if (emuThread) {
|
||||||
emuThread->SetRender(false);
|
emuThread->requestInterruption();
|
||||||
emuThread->Stop();
|
while (emuThread->isRunning())
|
||||||
emuThread->quit();
|
;
|
||||||
}
|
}
|
||||||
QApplication::quit();
|
QApplication::quit();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user