PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ rtpg_colormap_arg_destroy()

static void rtpg_colormap_arg_destroy ( rtpg_colormap_arg  arg)
static

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

4079  {
4080  int i = 0;
4081  if (arg->raster != NULL)
4082  rt_raster_destroy(arg->raster);
4083 
4084  if (arg->bandstats != NULL)
4085  pfree(arg->bandstats);
4086 
4087  if (arg->colormap != NULL) {
4088  if (arg->colormap->entry != NULL)
4089  pfree(arg->colormap->entry);
4090  pfree(arg->colormap);
4091  }
4092 
4093  if (arg->nentry) {
4094  for (i = 0; i < arg->nentry; i++) {
4095  if (arg->entry[i] != NULL)
4096  pfree(arg->entry[i]);
4097  }
4098  pfree(arg->entry);
4099  }
4100 
4101  if (arg->nelement) {
4102  for (i = 0; i < arg->nelement; i++)
4103  pfree(arg->element[i]);
4104  pfree(arg->element);
4105  }
4106 
4107  pfree(arg);
4108  arg = NULL;
4109 }
rt_colormap_entry entry
Definition: librtcore.h:2445
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: