We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3d2060b commit 6f32df1Copy full SHA for 6f32df1
2 files changed
src/xrCore/Threading/ThreadPool.hpp
@@ -51,12 +51,19 @@ class ThreadPool
51
setThreadCount(num_threads);
52
}
53
54
+ void destroy()
55
+ {
56
+ wait();
57
+ threads.clear();
58
+ }
59
+
60
// Sets the number of threads to be allocated in this pool
61
void setThreadCount(const uint32_t count)
62
{
63
threads.clear();
64
+ threads.reserve(count);
65
for (auto i = 0; i < count; i++)
- threads.push_back(std::make_unique<Thread>());
66
+ threads.emplace_back(std::make_unique<Thread>());
67
68
69
// Wait until all threads have finished their work items
src/xrCore/xrCore.cpp
@@ -132,6 +132,7 @@ void xrCore::_destroy()
132
--init_counter;
133
if (0 == init_counter)
134
135
+ ttapi.destroy();
136
FS._destroy();
137
EFS._destroy();
138
xr_delete(xr_FS);
0 commit comments