Fix memory leak when a viewport is re-initialized

issue1247
Armin Burgmeier 2015-01-13 07:46:23 -05:00
parent 92ce539b69
commit a5c2e762f7
1 changed files with 1 additions and 1 deletions

View File

@ -632,7 +632,7 @@ bool C4Viewport::Init(int32_t iPlayer, bool fSetTempOnly)
}
// Initialize FoW -- note that Init() can be called multiple times to
// change the player this viewport is showing.
if (pFoW == NULL) { delete pFoW; pFoW = NULL; }
if (pFoW != NULL) { delete pFoW; pFoW = NULL; }
if (::Landscape.pFoW && Player != NO_OWNER)
pFoW = new C4FoWRegion(::Landscape.pFoW, ::Players.Get(iPlayer));
return true;