mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-12 07:34:50 +00:00
- fixed memory leak: The sector links for dynamic lights were never freed.
This commit is contained in:
parent
7359631a43
commit
b2cf7d6512
1 changed files with 4 additions and 3 deletions
|
@ -411,7 +411,6 @@ size_t ADynamicLight::PointerSubstitution (DObject *old, DObject *notOld)
|
|||
// nodes that will get linked in later. Returns a pointer to the new node.
|
||||
//
|
||||
//=============================================================================
|
||||
static FreeList<FLightNode> freelist;
|
||||
|
||||
FLightNode * AddLightNode(FLightNode ** thread, void * linkto, ADynamicLight * light, FLightNode *& nextnode)
|
||||
{
|
||||
|
@ -431,7 +430,7 @@ FLightNode * AddLightNode(FLightNode ** thread, void * linkto, ADynamicLight * l
|
|||
// Couldn't find an existing node for this sector. Add one at the head
|
||||
// of the list.
|
||||
|
||||
node = freelist.GetNew();
|
||||
node = new FLightNode;
|
||||
|
||||
node->targ = linkto;
|
||||
node->lightsource = light;
|
||||
|
@ -474,7 +473,7 @@ static FLightNode * DeleteLightNode(FLightNode * node)
|
|||
|
||||
// Return this node to the freelist
|
||||
tn=node->nextTarget;
|
||||
freelist.Release(node);
|
||||
delete node;
|
||||
return(tn);
|
||||
}
|
||||
return(NULL);
|
||||
|
@ -661,6 +660,7 @@ void ADynamicLight::UnlinkLight ()
|
|||
}
|
||||
while (touching_sides) touching_sides = DeleteLightNode(touching_sides);
|
||||
while (touching_subsectors) touching_subsectors = DeleteLightNode(touching_subsectors);
|
||||
while (touching_sector) touching_sector = DeleteLightNode(touching_sector);
|
||||
}
|
||||
|
||||
void ADynamicLight::Destroy()
|
||||
|
@ -765,3 +765,4 @@ CCMD(listsublights)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue