From dea4efe9ec89edd24e8325bf5e36ea4c0849ce34 Mon Sep 17 00:00:00 2001 From: XieHan Date: Sat, 26 Feb 2022 17:38:48 +0800 Subject: [PATCH] Do not cleanup unfinished named counter on exit. --- src/factory/WFTaskFactory.cc | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/src/factory/WFTaskFactory.cc b/src/factory/WFTaskFactory.cc index be6ab3d8..a1546547 100644 --- a/src/factory/WFTaskFactory.cc +++ b/src/factory/WFTaskFactory.cc @@ -126,8 +126,6 @@ public: void count(struct __CounterList *counters, struct __counter_node *node); void remove(struct __CounterList *counters, struct __counter_node *node); - virtual ~__CounterMap(); - private: void count_n_locked(struct __CounterList *counters, unsigned int n, struct list_head *task_list); @@ -170,28 +168,6 @@ private: friend class __CounterMap; }; -__CounterMap::~__CounterMap() -{ - struct __CounterList *counters; - struct __counter_node *node; - struct list_head *pos; - struct list_head *tmp; - - while (counters_map_.rb_node) - { - counters = rb_entry(counters_map_.rb_node, struct __CounterList, rb); - list_for_each_safe(pos, tmp, &counters->head) - { - node = list_entry(pos, struct __counter_node, list); - counters->del(node); - delete node->task; - } - - rb_erase(counters_map_.rb_node, &counters_map_); - delete counters; - } -} - WFCounterTask *__CounterMap::create(const std::string& name, unsigned int target_value, std::function&& cb)