Merge pull request #75 from QuasarApp/asyncrenderloop
Some checks failed
buildbot/DocsGenerator Build finished.
buildbot/AndroidBuilder_v8Qt6 Build finished.
buildbot/LinuxCMakeBuilderQt6 Build finished.

fix async render loop
This commit is contained in:
Andrei Yankovich 2025-01-20 18:24:00 +01:00 committed by GitHub
commit f258591ec3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 1 deletions

View File

@ -15,6 +15,10 @@ AsyncRenderLoop::AsyncRenderLoop(QThread *thread, QObject *ptr): Async(thread, p
} }
AsyncRenderLoop::~AsyncRenderLoop() {
stop();
}
void QH::AsyncRenderLoop::run() { void QH::AsyncRenderLoop::run() {
m_run = true; m_run = true;
asyncLauncher([this](){ asyncLauncher([this](){
@ -25,7 +29,6 @@ void QH::AsyncRenderLoop::run() {
void QH::AsyncRenderLoop::stop() { void QH::AsyncRenderLoop::stop() {
m_run = false; m_run = false;
thread()->exit();
thread()->wait(); thread()->wait();
} }

View File

@ -41,6 +41,7 @@ class HEARTSHARED_EXPORT AsyncRenderLoop: public Async
Q_OBJECT Q_OBJECT
public: public:
AsyncRenderLoop(QThread* thread, QObject* ptr = nullptr); AsyncRenderLoop(QThread* thread, QObject* ptr = nullptr);
~AsyncRenderLoop();
/** /**
* @brief run This method starts the render loop. * @brief run This method starts the render loop.