mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2025-10-18 11:57:49 +00:00
let games gracefully exit
This commit is contained in:
parent
a0fa54b016
commit
786ec95e5d
3 changed files with 17 additions and 3 deletions
|
@ -11,6 +11,7 @@
|
|||
#include <QImage>
|
||||
#include <QStringList>
|
||||
#include <QThread>
|
||||
#include <QTimer>
|
||||
#include <QTouchEvent>
|
||||
#include <QWidget>
|
||||
|
||||
|
@ -87,6 +88,15 @@ public:
|
|||
* Requests for the emulation thread to stop running
|
||||
*/
|
||||
void RequestStop() {
|
||||
QTimer::singleShot(5000, this, &EmuThread::ForceStop);
|
||||
}
|
||||
|
||||
private slots:
|
||||
void ForceStop() {
|
||||
if (!IsRunning()) {
|
||||
return;
|
||||
}
|
||||
LOG_WARNING(Frontend, "Force stopping EmuThread");
|
||||
stop_source.request_stop();
|
||||
SetRunning(false);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue