mirror of
https://github.com/QuasarApp/Heart.git
synced 2025-05-14 02:19:41 +00:00
Merge pull request #75 from QuasarApp/asyncrenderloop
fix async render loop
This commit is contained in:
commit
f258591ec3
@ -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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user