summaryrefslogtreecommitdiff
path: root/core/thread_work_pool.h
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-02-13 11:28:35 +0100
committerGitHub <noreply@github.com>2020-02-13 11:28:35 +0100
commitf1ac2920847eafb7e89a27dcb98ecd4ee68b9750 (patch)
treef2cc8e2d0fc146f70c323ba89490e2ed23137970 /core/thread_work_pool.h
parent2f6ca917f75ca6bfbe28f4749825fdabde1d0531 (diff)
parenta23a52db3fcc58900f0e407469a9424c7045a3d2 (diff)
Merge pull request #36169 from timothyqiu/memleak
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);