PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ _rti_colormap_arg_destroy()

static void _rti_colormap_arg_destroy ( _rti_colormap_arg  arg)
static

Definition at line 1479 of file rt_mapalgebra.c.

References _rti_iterator_arg_t::band, _rti_colormap_arg_t::expr, _rti_colormap_arg_t::nexpr, _rti_colormap_arg_t::npos, _rti_colormap_arg_t::pos, _rti_colormap_arg_t::raster, rt_band_destroy(), rt_raster_destroy(), rt_raster_get_band(), rt_raster_get_num_bands(), and rtdealloc().

Referenced by rt_raster_colormap().

1479  {
1480  int i = 0;
1481 
1482  if (arg->raster != NULL) {
1483  rt_band band = NULL;
1484 
1485  for (i = rt_raster_get_num_bands(arg->raster) - 1; i >= 0; i--) {
1486  band = rt_raster_get_band(arg->raster, i);
1487  if (band != NULL)
1488  rt_band_destroy(band);
1489  }
1490 
1491  rt_raster_destroy(arg->raster);
1492  }
1493 
1494  if (arg->nexpr) {
1495  for (i = 0; i < arg->nexpr; i++) {
1496  if (arg->expr[i] != NULL)
1497  rtdealloc(arg->expr[i]);
1498  }
1499  rtdealloc(arg->expr);
1500  }
1501 
1502  if (arg->npos)
1503  rtdealloc(arg->pos);
1504 
1505  rtdealloc(arg);
1506  arg = NULL;
1507 }
rt_reclassexpr * expr
int rt_raster_get_num_bands(rt_raster raster)
Definition: rt_raster.c:372
band
Definition: ovdump.py:57
void rt_band_destroy(rt_band band)
Destroy a raster band.
Definition: rt_band.c:242
rt_band rt_raster_get_band(rt_raster raster, int bandNum)
Return Nth band, or NULL if unavailable.
Definition: rt_raster.c:381
void rt_raster_destroy(rt_raster raster)
Release memory associated to a raster.
Definition: rt_raster.c:82
void rtdealloc(void *mem)
Definition: rt_context.c:186
Here is the call graph for this function:
Here is the caller graph for this function: