diff --git a/src/gl/dynlights/a_dynlight.cpp b/src/gl/dynlights/a_dynlight.cpp index bcc126ecf..4507e783c 100644 --- a/src/gl/dynlights/a_dynlight.cpp +++ b/src/gl/dynlights/a_dynlight.cpp @@ -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 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) } } +