PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ lwcollection_free()

void lwcollection_free ( LWCOLLECTION col)

Definition at line 340 of file lwcollection.c.

References LWCOLLECTION::bbox, LWCOLLECTION::geoms, LWDEBUGF, lwfree(), lwgeom_free(), and LWCOLLECTION::ngeoms.

Referenced by _lwt_AddLineEdge(), BOX3D_to_LWGEOM(), lwcollection_homogenize(), lwgeom_free(), LWGEOM_geometryn_collection(), lwgeom_node(), lwgeom_split_wrapx(), lwgeom_subdivide(), lwgeom_to_x3d3(), lwt_ModEdgeSplit(), lwt_NewEdgesSplit(), pta_unstroke(), test_geos_subdivide(), test_lwcollection_extract(), test_lwline_clip(), test_lwline_clip_big(), test_lwline_split_by_point_to(), test_lwmline_clip(), and TWKBFromLWGEOMArray().

341 {
342  int i;
343  if ( ! col ) return;
344 
345  if ( col->bbox )
346  {
347  lwfree(col->bbox);
348  }
349  for ( i = 0; i < col->ngeoms; i++ )
350  {
351  LWDEBUGF(4,"freeing geom[%d]", i);
352  if ( col->geoms && col->geoms[i] )
353  lwgeom_free(col->geoms[i]);
354  }
355  if ( col->geoms )
356  {
357  lwfree(col->geoms);
358  }
359  lwfree(col);
360 }
void lwfree(void *mem)
Definition: lwutil.c:244
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1099
GBOX * bbox
Definition: liblwgeom.h:505
LWGEOM ** geoms
Definition: liblwgeom.h:509
#define LWDEBUGF(level, msg,...)
Definition: lwgeom_log.h:88
Here is the call graph for this function:
Here is the caller graph for this function: