Fix memory leak in draggers

This commit is contained in:
def 2019-04-08 21:54:12 +02:00
parent a4e2130342
commit 173b43d487
2 changed files with 9 additions and 8 deletions

View file

@ -392,13 +392,14 @@ CDraggerTeam::CDraggerTeam(CGameWorld *pGameWorld, vec2 Pos, float Strength,
{
for (int i = 0; i < MAX_CLIENTS; ++i)
{
m_Draggers[i] = new CDragger(pGameWorld, Pos, Strength, NW, i, Layer,
Number);
m_Draggers[i] = new CDragger(pGameWorld, Pos, Strength, NW, i, Layer, Number);
}
}
//CDraggerTeam::~CDraggerTeam() {
//for(int i = 0; i < MAX_CLIENTS; ++i) {
// delete m_Draggers[i];
//}
//}
CDraggerTeam::~CDraggerTeam()
{
for (int i = 0; i < MAX_CLIENTS; ++i)
{
delete m_Draggers[i];
}
}

View file

@ -36,7 +36,7 @@ public:
CDraggerTeam(CGameWorld *pGameWorld, vec2 Pos, float Strength, bool NW =
false, int Layer = 0, int Number = 0);
//~CDraggerTeam();
~CDraggerTeam();
};
#endif // GAME_SERVER_ENTITIES_DRAGGER_H