File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -51,12 +51,19 @@ class ThreadPool
5151 setThreadCount (num_threads);
5252 }
5353
54+ void destroy ()
55+ {
56+ wait ();
57+ threads.clear ();
58+ }
59+
5460 // Sets the number of threads to be allocated in this pool
5561 void setThreadCount (const uint32_t count)
5662 {
5763 threads.clear ();
64+ threads.reserve (count);
5865 for (auto i = 0 ; i < count; i++)
59- threads.push_back (std::make_unique<Thread>());
66+ threads.emplace_back (std::make_unique<Thread>());
6067 }
6168
6269 // Wait until all threads have finished their work items
Original file line number Diff line number Diff line change @@ -132,6 +132,7 @@ void xrCore::_destroy()
132132 --init_counter;
133133 if (0 == init_counter)
134134 {
135+ ttapi.destroy ();
135136 FS._destroy ();
136137 EFS._destroy ();
137138 xr_delete (xr_FS);
You can’t perform that action at this time.
0 commit comments