[fnd] Initialise memory in Vec.

This commit is contained in:
jakcron 2018-07-04 13:00:49 +08:00
parent 7ce716180f
commit 5b9b85a7c4

View file

@ -146,6 +146,11 @@ namespace fnd
{
fnd::Exception("Vec", "Failed to allocate memory for vector");
}
for (size_t i = 0; i < new_size; i++)
{
m_Vec[i] = 0;
}
m_Size = new_size;
}
@ -159,6 +164,10 @@ namespace fnd
{
fnd::Exception("Vec", "Failed to allocate memory for vector");
}
for (size_t i = 0; i < new_size; i++)
{
new_vec[i] = 0;
}
for (size_t i = 0; i < _MIN(m_Size, new_size); i++)
{