PostGIS  2.3.8dev-r@@SVN_REVISION@@

◆ rtpg_colormap_arg_destroy()

static void rtpg_colormap_arg_destroy ( rtpg_colormap_arg  arg)
static

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

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