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

◆ raster_destroy()

static void raster_destroy ( rt_raster  raster)
static

Definition at line 79 of file raster2pgsql.c.

79 {
80 uint16_t i;
81 uint16_t nbands = rt_raster_get_num_bands(raster);
82 for (i = 0; i < nbands; i++) {
83 rt_band band = rt_raster_get_band(raster, i);
84 if (band == NULL) continue;
85
86 if (!rt_band_is_offline(band) && !rt_band_get_ownsdata_flag(band)) {
87 void* mem = rt_band_get_data(band);
88 if (mem) rtdealloc(mem);
89 }
90 rt_band_destroy(band);
91 }
92 rt_raster_destroy(raster);
93}
void * rt_band_get_data(rt_band band)
Get pointer to raster band data.
Definition rt_band.c:400
void rt_raster_destroy(rt_raster raster)
Release memory associated to a raster.
Definition rt_raster.c:82
void rt_band_destroy(rt_band band)
Destroy a raster band.
Definition rt_band.c:340
uint16_t rt_raster_get_num_bands(rt_raster raster)
Definition rt_raster.c:372
void rtdealloc(void *mem)
Definition rt_context.c:186
int rt_band_get_ownsdata_flag(rt_band band)
Return 0 (FALSE) or non-zero (TRUE) indicating if rt_band is responsible for managing the memory for ...
Definition rt_band.c:659
int rt_band_is_offline(rt_band band)
Return non-zero if the given band data is on the filesystem.
Definition rt_band.c:329
rt_band rt_raster_get_band(rt_raster raster, int bandNum)
Return Nth band, or NULL if unavailable.
Definition rt_raster.c:381

References rt_band_destroy(), rt_band_get_data(), rt_band_get_ownsdata_flag(), rt_band_is_offline(), rt_raster_destroy(), rt_raster_get_band(), rt_raster_get_num_bands(), and rtdealloc().

Referenced by build_overview(), and convert_raster().

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