mirror of
https://github.com/lubosz/overte.git
synced 2025-08-07 18:21:16 +02:00
use a sleep instead of a yield waiting for close event
This commit is contained in:
parent
e3d8229abe
commit
d89febac71
1 changed files with 3 additions and 2 deletions
|
@ -11,6 +11,7 @@
|
||||||
|
|
||||||
#include "Application.h"
|
#include "Application.h"
|
||||||
|
|
||||||
|
#include <chrono>
|
||||||
#include <thread>
|
#include <thread>
|
||||||
|
|
||||||
#include <gl/Config.h>
|
#include <gl/Config.h>
|
||||||
|
@ -1747,8 +1748,8 @@ Application::~Application() {
|
||||||
// make sure that the quit event has finished sending before we take the application down
|
// make sure that the quit event has finished sending before we take the application down
|
||||||
auto closeEventSender = DependencyManager::get<CloseEventSender>();
|
auto closeEventSender = DependencyManager::get<CloseEventSender>();
|
||||||
while (!closeEventSender->hasFinishedQuitEvent() && !closeEventSender->hasTimedOutQuitEvent()) {
|
while (!closeEventSender->hasFinishedQuitEvent() && !closeEventSender->hasTimedOutQuitEvent()) {
|
||||||
// yield so we're not spinning
|
// sleep a little so we're not spinning at 100%
|
||||||
std::this_thread::yield();
|
std::this_thread::sleep_for(std::chrono::milliseconds(10));
|
||||||
}
|
}
|
||||||
// quit the thread used by the closure event sender
|
// quit the thread used by the closure event sender
|
||||||
closeEventSender->thread()->quit();
|
closeEventSender->thread()->quit();
|
||||||
|
|
Loading…
Reference in a new issue