Skip to content

Commit

Permalink
Fix mem leak
Browse files Browse the repository at this point in the history
  • Loading branch information
snocx committed Apr 28, 2020
1 parent dc3b87e commit 91e22d0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions core/logic/CDataPack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,13 @@ CDataPack::Free(CDataPack *pack)

void CDataPack::Initialize()
{
position = 0;

do
{
} while (this->RemoveItem());

elements.clear();
position = 0;
}

void CDataPack::ResetSize()
Expand Down Expand Up @@ -228,7 +229,7 @@ bool CDataPack::RemoveItem(size_t pos)
{
case CDataPackType::Raw:
{
delete elements[pos].pData.vval;
delete [] elements[pos].pData.vval;
break;
}

Expand Down

0 comments on commit 91e22d0

Please sign in to comment.