| 398 | } |
| 399 | |
| 400 | void EmuThread::stop() { |
| 401 | // Need to run events to allow queued slots to be processed during exit |
| 402 | QEventLoop eventLoop; |
| 403 | connect(this, &QThread::finished, &eventLoop, [&]() { eventLoop.exit(0); }); |
| 404 | if (!isRunning()) { |
| 405 | return; |
| 406 | } |
| 407 | emu_exit(); |
| 408 | QTimer::singleShot(500, &eventLoop, [&]() { eventLoop.exit(1); }); |
| 409 | if (eventLoop.exec()) { |
| 410 | terminate(); |
| 411 | wait(500); |
| 412 | } |
| 413 | } |
no outgoing calls
no test coverage detected