Fix id_idle() for UIThreadWorker
This commit is contained in:
parent
b00c550463
commit
6ab8e3a138
1 changed files with 8 additions and 4 deletions
|
@ -75,12 +75,14 @@ public:
|
||||||
bool push(std::unique_ptr<Job> job) override
|
bool push(std::unique_ptr<Job> job) override
|
||||||
{
|
{
|
||||||
m_canceled = false;
|
m_canceled = false;
|
||||||
|
|
||||||
|
if (job)
|
||||||
m_jobqueue.push(std::move(job));
|
m_jobqueue.push(std::move(job));
|
||||||
|
|
||||||
return bool(job);
|
return bool(job);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool is_idle() const override { return !m_running; }
|
bool is_idle() const override { return !m_running && m_jobqueue.empty(); }
|
||||||
|
|
||||||
void cancel() override { m_canceled = true; }
|
void cancel() override { m_canceled = true; }
|
||||||
|
|
||||||
|
@ -88,7 +90,9 @@ public:
|
||||||
{
|
{
|
||||||
m_canceled = true;
|
m_canceled = true;
|
||||||
process_front();
|
process_front();
|
||||||
while (!m_jobqueue.empty()) m_jobqueue.pop();
|
|
||||||
|
while (!m_jobqueue.empty())
|
||||||
|
m_jobqueue.pop();
|
||||||
}
|
}
|
||||||
|
|
||||||
void process_events() override {
|
void process_events() override {
|
||||||
|
|
Loading…
Add table
Reference in a new issue