PostGIS 3.7.0dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ rtpg_union_arg_destroy()

static void rtpg_union_arg_destroy ( rtpg_union_arg  arg)
static

Definition at line 1731 of file rtpg_mapalgebra.c.

1731 {
1732 int i = 0;
1733 int j = 0;
1734 int k = 0;
1735
1736 if (arg->bandarg != NULL) {
1737 for (i = 0; i < arg->numband; i++) {
1738 if (!arg->bandarg[i].numraster)
1739 continue;
1740
1741 for (j = 0; j < arg->bandarg[i].numraster; j++) {
1742 if (arg->bandarg[i].raster[j] == NULL)
1743 continue;
1744
1745 for (k = rt_raster_get_num_bands(arg->bandarg[i].raster[j]) - 1; k >= 0; k--)
1747 rt_raster_destroy(arg->bandarg[i].raster[j]);
1748 }
1749
1750 pfree(arg->bandarg[i].raster);
1751 }
1752
1753 pfree(arg->bandarg);
1754 }
1755
1756 pfree(arg);
1757}
void rt_raster_destroy(rt_raster raster)
Release memory associated to a raster.
Definition rt_raster.c:86
void rt_band_destroy(rt_band band)
Destroy a raster band.
Definition rt_band.c:499
uint16_t rt_raster_get_num_bands(rt_raster raster)
Definition rt_raster.c:376
rt_band rt_raster_get_band(rt_raster raster, int bandNum)
Return Nth band, or NULL if unavailable.
Definition rt_raster.c:385
rtpg_union_band_arg bandarg

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().

Here is the call graph for this function:
Here is the caller graph for this function: