render: fix issue responding to cancelled tasks

This commit is contained in:
itsmattkc
2022-07-10 12:54:55 -07:00
parent 963ffe8de3
commit a8d46c4c5f
17 changed files with 98 additions and 164 deletions
+11 -8
View File
@@ -21,35 +21,38 @@
#ifndef CANCELABLEOBJECT_H
#define CANCELABLEOBJECT_H
#include <QAtomicInt>
#include "common/define.h"
#include "render/cancelatom.h"
namespace olive {
class CancelableObject {
public:
CancelableObject() :
cancelled_(false)
CancelableObject()
{
}
void Cancel()
{
cancelled_ = true;
cancel_.Cancel();
CancelEvent();
}
const QAtomicInt& IsCancelled() const
CancelAtom *GetCancelAtom()
{
return cancelled_;
return &cancel_;
}
bool IsCancelled()
{
return cancel_.IsCancelled();
}
protected:
virtual void CancelEvent(){}
private:
QAtomicInt cancelled_;
CancelAtom cancel_;
};