Skip to content

Commit

Permalink
Merged pull request "Fixing static_vector memory leak in validatePipe…
Browse files Browse the repository at this point in the history
…lineBindingLayouts": #55
  • Loading branch information
apanteleev committed Jul 3, 2024
2 parents 9411223 + 4dc4f3a commit 6945d2a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/nvrhi/common/containers.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,12 @@ struct static_vector : private std::array<T, _max_elements>
if (current_size > new_size)
{
for (size_type i = new_size; i < current_size; i++)
(data() + i)->~T();
*(data() + i) = T{};
}
else
{
for (size_type i = current_size; i < new_size; i++)
new (data() + i) T();
*(data() + i) = T{};
}

current_size = new_size;
Expand Down

0 comments on commit 6945d2a

Please sign in to comment.