Skip to content

Commit

Permalink
Merge pull request #75 from QuasarApp/asyncrenderloop
Browse files Browse the repository at this point in the history
fix async render loop
  • Loading branch information
EndrII authored Jan 20, 2025
2 parents 53bf009 + 58f1cb2 commit f258591
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/public/asyncrenderloop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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](){
Expand All @@ -25,7 +29,6 @@ void QH::AsyncRenderLoop::run() {

void QH::AsyncRenderLoop::stop() {
m_run = false;
thread()->exit();
thread()->wait();
}

Expand Down
1 change: 1 addition & 0 deletions src/public/asyncrenderloop.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit f258591

Please sign in to comment.