forked from Mirrors/openclonk
Fix memory leak when a viewport is re-initialized
parent
92ce539b69
commit
a5c2e762f7
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue