PostGIS  2.5.0beta2dev-r@@SVN_REVISION@@

◆ rtpg_union_arg_destroy()

static void rtpg_union_arg_destroy ( rtpg_union_arg  arg)
static

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

1706  {
1707  int i = 0;
1708  int j = 0;
1709  int k = 0;
1710 
1711  if (arg->bandarg != NULL) {
1712  for (i = 0; i < arg->numband; i++) {
1713  if (!arg->bandarg[i].numraster)
1714  continue;
1715 
1716  for (j = 0; j < arg->bandarg[i].numraster; j++) {
1717  if (arg->bandarg[i].raster[j] == NULL)
1718  continue;
1719 
1720  for (k = rt_raster_get_num_bands(arg->bandarg[i].raster[j]) - 1; k >= 0; k--)
1722  rt_raster_destroy(arg->bandarg[i].raster[j]);
1723  }
1724 
1725  pfree(arg->bandarg[i].raster);
1726  }
1727 
1728  pfree(arg->bandarg);
1729  }
1730 
1731  pfree(arg);
1732 }
uint16_t 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:340
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: