fix render loop run and stop functions
Some checks failed
buildbot/DocsGenerator Build finished.
buildbot/AndroidBuilder_v8Qt6 Build finished.
buildbot/LinuxCMakeBuilderQt6 Build finished.

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

View File

@ -20,11 +20,16 @@ AsyncRenderLoop::~AsyncRenderLoop() {
}
void QH::AsyncRenderLoop::run() {
m_run = true;
asyncLauncher([this](){
renderLoopPrivate();
return true;
});
if (auto && thrd = thread()) {
m_run = true;
thrd->start();
asyncLauncher([this](){
renderLoopPrivate();
return true;
});
}
}
void QH::AsyncRenderLoop::stop() {
@ -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() {