PostGIS  2.1.10dev-r@@SVN_REVISION@@
static void rtpg_union_arg_destroy ( rtpg_union_arg  arg)
static

Definition at line 17767 of file rt_pg.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().

17767  {
17768  int i = 0;
17769  int j = 0;
17770  int k = 0;
17771 
17772  if (arg->bandarg != NULL) {
17773  for (i = 0; i < arg->numband; i++) {
17774  if (!arg->bandarg[i].numraster)
17775  continue;
17776 
17777  for (j = 0; j < arg->bandarg[i].numraster; j++) {
17778  if (arg->bandarg[i].raster[j] == NULL)
17779  continue;
17780 
17781  for (k = rt_raster_get_num_bands(arg->bandarg[i].raster[j]) - 1; k >= 0; k--)
17783  rt_raster_destroy(arg->bandarg[i].raster[j]);
17784  }
17785 
17786  pfree(arg->bandarg[i].raster);
17787  }
17788 
17789  pfree(arg->bandarg);
17790  }
17791 
17792  pfree(arg);
17793 }
int rt_raster_get_num_bands(rt_raster raster)
Definition: rt_api.c:5677
void rt_raster_destroy(rt_raster raster)
Release memory associated to a raster.
Definition: rt_api.c:5387
rtpg_union_band_arg bandarg
Definition: rt_pg.c:17764
rt_raster * raster
Definition: rt_pg.c:17758
void rt_band_destroy(rt_band band)
Destroy a raster band.
Definition: rt_api.c:1650
rt_band rt_raster_get_band(rt_raster raster, int n)
Return Nth band, or NULL if unavailable.
Definition: rt_api.c:5686

Here is the call graph for this function:

Here is the caller graph for this function: