summaryrefslogtreecommitdiffstats
path: root/core/thread_work_pool.h
diff options
context:
space:
mode:
authorHaoyu Qiu <timothyqiu32@gmail.com>2020-02-13 09:39:01 +0800
committerHaoyu Qiu <timothyqiu32@gmail.com>2020-02-13 09:46:13 +0800
commita23a52db3fcc58900f0e407469a9424c7045a3d2 (patch)
treedffdca0a36cea3dcf20b9f4ff30bbe8abb5f3ebf /core/thread_work_pool.h
parentc48237967a0a4d3901c157a828017d7330df0578 (diff)
downloadredot-engine-a23a52db3fcc58900f0e407469a9424c7045a3d2.tar.gz
Fixes some memory leaks
Diffstat (limited to 'core/thread_work_pool.h')
-rw-r--r--core/thread_work_pool.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/core/thread_work_pool.h b/core/thread_work_pool.h
index 3dedb40752..214d2c4aa7 100644
--- a/core/thread_work_pool.h
+++ b/core/thread_work_pool.h
@@ -43,6 +43,7 @@ class ThreadWorkPool {
std::atomic<uint32_t> *index;
uint32_t max_elements;
virtual void work() = 0;
+ virtual ~BaseWork() = default;
};
template <class C, class M, class U>
@@ -98,6 +99,8 @@ public:
threads[i].completed.wait();
threads[i].work = nullptr;
}
+
+ memdelete(w);
}
void init(int p_thread_count = -1);