diff --git a/src/public/asyncrenderloop.cpp b/src/public/asyncrenderloop.cpp index d8dd2b9..43f14e3 100644 --- a/src/public/asyncrenderloop.cpp +++ b/src/public/asyncrenderloop.cpp @@ -15,6 +15,10 @@ AsyncRenderLoop::AsyncRenderLoop(QThread *thread, QObject *ptr): Async(thread, p } +AsyncRenderLoop::~AsyncRenderLoop() { + stop(); +} + void QH::AsyncRenderLoop::run() { m_run = true; asyncLauncher([this](){ @@ -25,7 +29,6 @@ void QH::AsyncRenderLoop::run() { void QH::AsyncRenderLoop::stop() { m_run = false; - thread()->exit(); thread()->wait(); } diff --git a/src/public/asyncrenderloop.h b/src/public/asyncrenderloop.h index cf0e767..ea3f210 100644 --- a/src/public/asyncrenderloop.h +++ b/src/public/asyncrenderloop.h @@ -41,6 +41,7 @@ class HEARTSHARED_EXPORT AsyncRenderLoop: public Async Q_OBJECT public: AsyncRenderLoop(QThread* thread, QObject* ptr = nullptr); + ~AsyncRenderLoop(); /** * @brief run This method starts the render loop.