fix timeout not init safety_flag
This commit is contained in:
parent
d716ac684e
commit
ab0379f7f5
@ -54,7 +54,7 @@ private:
|
|||||||
inline std::function<void()>
|
inline std::function<void()>
|
||||||
SafeTask(scoped_refptr<PendingTaskSafetyFlag> flag, std::function<void()> task)
|
SafeTask(scoped_refptr<PendingTaskSafetyFlag> flag, std::function<void()> task)
|
||||||
{
|
{
|
||||||
return [task, flag]() mutable {
|
return [flag, task]() mutable {
|
||||||
if (flag->alive()) { std::move(task)(); }
|
if (flag->alive()) { std::move(task)(); }
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,8 @@ namespace sled {
|
|||||||
TaskQueueTimeoutFactory::TaskQueueTimeout::TaskQueueTimeout(TaskQueueTimeoutFactory &parent,
|
TaskQueueTimeoutFactory::TaskQueueTimeout::TaskQueueTimeout(TaskQueueTimeoutFactory &parent,
|
||||||
sled::TaskQueueBase::DelayPrecision precision)
|
sled::TaskQueueBase::DelayPrecision precision)
|
||||||
: parent_(parent),
|
: parent_(parent),
|
||||||
precision_(precision)
|
precision_(precision),
|
||||||
|
safety_flag_(PendingTaskSafetyFlag::Create())
|
||||||
{}
|
{}
|
||||||
|
|
||||||
TaskQueueTimeoutFactory::TaskQueueTimeout::~TaskQueueTimeout() {}
|
TaskQueueTimeoutFactory::TaskQueueTimeout::~TaskQueueTimeout() {}
|
||||||
|
Loading…
Reference in New Issue
Block a user