From b2ebc555e920cde0e258e76b7d411c5b9237f203 Mon Sep 17 00:00:00 2001 From: xiehan <52160700+Barenboim@users.noreply.github.com> Date: Tue, 10 Nov 2020 00:44:35 +0800 Subject: [PATCH] Update SeriesWork (#149) * add Workflow::unset_last_task() * fix comments Co-authored-by: XieHan --- src/factory/WFGraphTask.cc | 2 +- src/factory/Workflow.h | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/factory/WFGraphTask.cc b/src/factory/WFGraphTask.cc index 1fec732436..dc2e95da12 100644 --- a/src/factory/WFGraphTask.cc +++ b/src/factory/WFGraphTask.cc @@ -86,7 +86,7 @@ WFGraphTask::~WFGraphTask() for (i = 0; i < this->parallel->size(); i++) { series = const_cast(this->parallel->series_at(i)); - series->set_last_task(new WFGenericTask); + series->unset_last_task(); } this->parallel->dismiss(); diff --git a/src/factory/Workflow.h b/src/factory/Workflow.h index b16b9aaa4b..855751d3a1 100644 --- a/src/factory/Workflow.h +++ b/src/factory/Workflow.h @@ -105,7 +105,7 @@ class SeriesWork } public: - /* pop() and set_task_task() are intended for framework providers only. */ + /* The next 3 methods are intended for task implementations only. */ SubTask *pop(); void set_last_task(SubTask *last) @@ -114,6 +114,8 @@ class SeriesWork this->last = last; } + void unset_last_task() { this->last = NULL; } + protected: void *context; series_callback_t callback;