resolve memory leak in VecDeque

This commit is contained in:
Vighnesh 2024-01-12 14:11:40 -08:00
parent 2f7509dedd
commit 38aa074767

View file

@ -54,7 +54,7 @@ private:
size_t tail_size = queue_size - head_size; // how many elements are in the tail portion (i.e. any portion that wrapped to the front)
// we have to destroy every element in the head portion
for (size_t index = head; index < head_size; index++)
for (size_t index = head; index < head + head_size; index++)
buffer[index].~T();
// and any in the tail portion, if one exists