PostGIS  3.0.0dev-r@@SVN_REVISION@@

◆ rtpg_colormap_arg_destroy()

static void rtpg_colormap_arg_destroy ( rtpg_colormap_arg  arg)
static

Definition at line 4025 of file rtpg_mapalgebra.c.

References rtpg_colormap_arg_t::bandstats, rtpg_colormap_arg_t::colormap, rtpg_colormap_arg_t::element, rt_colormap_t::entry, rtpg_colormap_arg_t::entry, rtpg_colormap_arg_t::nelement, rtpg_colormap_arg_t::nentry, PG_FUNCTION_INFO_V1(), rtpg_colormap_arg_t::raster, RASTER_colorMap(), and rt_raster_destroy().

Referenced by RASTER_colorMap().

4025  {
4026  uint32_t i = 0;
4027  if (arg->raster != NULL)
4028  rt_raster_destroy(arg->raster);
4029 
4030  if (arg->bandstats != NULL)
4031  pfree(arg->bandstats);
4032 
4033  if (arg->colormap != NULL) {
4034  if (arg->colormap->entry != NULL)
4035  pfree(arg->colormap->entry);
4036  pfree(arg->colormap);
4037  }
4038 
4039  if (arg->nentry) {
4040  for (i = 0; i < arg->nentry; i++) {
4041  if (arg->entry[i] != NULL)
4042  pfree(arg->entry[i]);
4043  }
4044  pfree(arg->entry);
4045  }
4046 
4047  if (arg->nelement) {
4048  for (i = 0; i < arg->nelement; i++)
4049  pfree(arg->element[i]);
4050  pfree(arg->element);
4051  }
4052 
4053  pfree(arg);
4054  arg = NULL;
4055 }
unsigned int uint32_t
Definition: uthash.h:78
rt_colormap_entry entry
Definition: librtcore.h:2496
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: