shader: Fix use-after-free bug in object_pool

This commit is contained in:
ReinUsesLisp 2021-03-23 22:07:14 -03:00 committed by ameerj
parent 3d07cef009
commit 1d2db78398
1 changed files with 3 additions and 3 deletions

View File

@ -32,12 +32,12 @@ public:
const size_t total_objects{root.num_objects + new_chunk_size * (chunks.size() - 1)}; const size_t total_objects{root.num_objects + new_chunk_size * (chunks.size() - 1)};
chunks.clear(); chunks.clear();
chunks.emplace_back(total_objects); chunks.emplace_back(total_objects);
chunks.shrink_to_fit();
} else { } else {
root.Release(); root.Release();
chunks.resize(1); chunks.resize(1);
chunks.shrink_to_fit();
} }
chunks.shrink_to_fit();
node = &chunks.front();
} }
private: private: