PostGIS 3.0.6dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ lwgeom_release()

void lwgeom_release ( LWGEOM lwgeom)
extern

Free the containing LWGEOM and the associated BOX.

Leave the underlying geoms/points/point objects intact. Useful for functions that are stripping out subcomponents of complex objects, or building up new temporary objects on top of subcomponents.

Definition at line 450 of file lwgeom.c.

451{
452 if ( ! lwgeom )
453 lwerror("lwgeom_release: someone called on 0x0");
454
455 LWDEBUGF(3, "releasing type %s", lwtype_name(lwgeom->type));
456
457 /* Drop bounding box (always a copy) */
458 if ( lwgeom->bbox )
459 {
460 LWDEBUGF(3, "lwgeom_release: releasing bbox. %p", lwgeom->bbox);
461 lwfree(lwgeom->bbox);
462 }
463 lwfree(lwgeom);
464
465}
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
Definition lwutil.c:216
void lwfree(void *mem)
Definition lwutil.c:242
#define LWDEBUGF(level, msg,...)
Definition lwgeom_log.h:88
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition lwutil.c:190
uint8_t type
Definition liblwgeom.h:448
GBOX * bbox
Definition liblwgeom.h:444

References LWGEOM::bbox, LWDEBUGF, lwerror(), lwfree(), lwtype_name(), and LWGEOM::type.

Referenced by geom_from_kml(), lwcircstring_release(), lwcollection_release(), LWGEOM_exteriorring_polygon(), LWGEOM_interiorringn_polygon(), lwline_release(), lwmline_release(), lwmpoint_release(), lwmpoly_release(), lwmpoly_to_points(), lwpoint_release(), lwpoly_release(), and lwtriangle_release().

Here is the call graph for this function:
Here is the caller graph for this function: