4
1
mirror of https://github.com/QuasarApp/Heart.git synced 2025-05-04 05:29:41 +00:00

fix render loop run and stop functions

This commit is contained in:
Andrei Yankovich 2025-01-28 15:46:52 +01:00
parent fe2773e4c9
commit 880c91320a

@ -20,13 +20,18 @@ AsyncRenderLoop::~AsyncRenderLoop() {
}
void QH::AsyncRenderLoop::run() {
if (auto && thrd = thread()) {
m_run = true;
thrd->start();
asyncLauncher([this](){
renderLoopPrivate();
return true;
});
}
}
void QH::AsyncRenderLoop::stop() {
m_run = false;
thread()->quit();
@ -34,7 +39,7 @@ void QH::AsyncRenderLoop::stop() {
}
bool AsyncRenderLoop::isRun() const {
return m_run || (thread() && thread()->isRunning());
return m_run && (thread() && thread()->isRunning());
}
void QH::AsyncRenderLoop::renderLoopPrivate() {