Skip to content

Commit

Permalink
Core/Battlefield: Fix some memory leaks
Browse files Browse the repository at this point in the history
  • Loading branch information
kaelima committed Sep 3, 2012
1 parent b979e81 commit 76be70a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/server/game/Battlefield/Battlefield.cpp
Expand Up @@ -60,6 +60,13 @@ Battlefield::Battlefield()

Battlefield::~Battlefield()
{
for (BfCapturePointMap::iterator itr = m_capturePoints.begin(); itr != m_capturePoints.end(); ++itr)
delete itr->second;

for (GraveyardVect::const_iterator itr = m_GraveyardList.begin(); itr != m_GraveyardList.end(); ++itr)
delete *itr;

m_capturePoints.clear();
}

// Called when a player enters the zone
Expand Down
3 changes: 3 additions & 0 deletions src/server/game/Battlefield/Zones/BattlefieldWG.cpp
Expand Up @@ -37,6 +37,9 @@ BattlefieldWG::~BattlefieldWG()
{
for (Workshop::const_iterator itr = WorkshopsList.begin(); itr != WorkshopsList.end(); ++itr)
delete *itr;

for (GameObjectBuilding::const_iterator itr = BuildingsInZone.begin(); itr != BuildingsInZone.end(); ++itr)
delete *itr;
}

bool BattlefieldWG::SetupBattlefield()
Expand Down

0 comments on commit 76be70a

Please sign in to comment.