PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ rtpg_union_arg_destroy()

static void rtpg_union_arg_destroy ( rtpg_union_arg  arg)
static

Definition at line 1759 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().

1759  {
1760  int i = 0;
1761  int j = 0;
1762  int k = 0;
1763 
1764  if (arg->bandarg != NULL) {
1765  for (i = 0; i < arg->numband; i++) {
1766  if (!arg->bandarg[i].numraster)
1767  continue;
1768 
1769  for (j = 0; j < arg->bandarg[i].numraster; j++) {
1770  if (arg->bandarg[i].raster[j] == NULL)
1771  continue;
1772 
1773  for (k = rt_raster_get_num_bands(arg->bandarg[i].raster[j]) - 1; k >= 0; k--)
1775  rt_raster_destroy(arg->bandarg[i].raster[j]);
1776  }
1777 
1778  pfree(arg->bandarg[i].raster);
1779  }
1780 
1781  pfree(arg->bandarg);
1782  }
1783 
1784  pfree(arg);
1785 }
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: