Merge pull request #36169 from timothyqiu/memleak

Fixes some memory leaks
This commit is contained in:
Rémi Verschelde 2020-02-13 11:28:35 +01:00 committed by GitHub
commit f1ac292084
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 72 additions and 18 deletions

View file

@ -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);