PostGIS  2.3.8dev-r@@SVN_REVISION@@

◆ rtpg_union_arg_destroy()

static void rtpg_union_arg_destroy ( rtpg_union_arg  arg)
static

Definition at line 1709 of file rtpg_mapalgebra.c.

References rtpg_union_arg_t::bandarg, rtpg_union_arg_t::numband, rtpg_union_band_arg_t::numraster, rtpg_union_band_arg_t::raster, rt_band_destroy(), rt_raster_destroy(), rt_raster_get_band(), and rt_raster_get_num_bands().

Referenced by RASTER_union_finalfn(), and RASTER_union_transfn().

1709  {
1710  int i = 0;
1711  int j = 0;
1712  int k = 0;
1713 
1714  if (arg->bandarg != NULL) {
1715  for (i = 0; i < arg->numband; i++) {
1716  if (!arg->bandarg[i].numraster)
1717  continue;
1718 
1719  for (j = 0; j < arg->bandarg[i].numraster; j++) {
1720  if (arg->bandarg[i].raster[j] == NULL)
1721  continue;
1722 
1723  for (k = rt_raster_get_num_bands(arg->bandarg[i].raster[j]) - 1; k >= 0; k--)
1725  rt_raster_destroy(arg->bandarg[i].raster[j]);
1726  }
1727 
1728  pfree(arg->bandarg[i].raster);
1729  }
1730 
1731  pfree(arg->bandarg);
1732  }
1733 
1734  pfree(arg);
1735 }
int rt_raster_get_num_bands(rt_raster raster)
Definition: rt_raster.c:372
rtpg_union_band_arg bandarg
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
Here is the call graph for this function:
Here is the caller graph for this function: