PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ _rti_warp_arg_destroy()

static void _rti_warp_arg_destroy ( _rti_warp_arg  arg)
static

Definition at line 105 of file rt_warp.c.

References _rti_warp_arg_t::destroy_drv, _rti_warp_arg_t::drv, _rti_warp_arg_t::ds, _rti_warp_arg_t::dst, rtdealloc(), _rti_warp_arg_t::src, _rti_warp_arg_t::srs, _rti_warp_arg_t::transform, and _rti_warp_arg_t::wopts.

Referenced by rt_raster_gdal_warp().

105  {
106  int i = 0;
107 
108  if (arg->dst.ds != NULL)
109  GDALClose(arg->dst.ds);
110  if (arg->dst.srs != NULL)
111  CPLFree(arg->dst.srs);
112 
113  if (arg->dst.drv != NULL && arg->dst.destroy_drv) {
114  GDALDeregisterDriver(arg->dst.drv);
115  GDALDestroyDriver(arg->dst.drv);
116  }
117 
118  if (arg->src.ds != NULL)
119  GDALClose(arg->src.ds);
120  if (arg->src.srs != NULL)
121  CPLFree(arg->src.srs);
122 
123  if (arg->src.drv != NULL && arg->src.destroy_drv) {
124  GDALDeregisterDriver(arg->src.drv);
125  GDALDestroyDriver(arg->src.drv);
126  }
127 
128  if (arg->transform.func == GDALApproxTransform) {
129  if (arg->transform.arg.imgproj != NULL)
130  GDALDestroyGenImgProjTransformer(arg->transform.arg.imgproj);
131  }
132 
133  if (arg->wopts != NULL)
134  GDALDestroyWarpOptions(arg->wopts);
135 
136  if (arg->transform.option.len > 0 && arg->transform.option.item != NULL) {
137  for (i = 0; i < arg->transform.option.len; i++) {
138  if (arg->transform.option.item[i] != NULL)
139  rtdealloc(arg->transform.option.item[i]);
140  }
141  rtdealloc(arg->transform.option.item);
142  }
143 
144  rtdealloc(arg);
145  arg = NULL;
146 }
GDALWarpOptions * wopts
Definition: rt_warp.c:51
char * srs
Definition: rt_warp.c:47
int destroy_drv
Definition: rt_warp.c:48
GDALDatasetH ds
Definition: rt_warp.c:46
void rtdealloc(void *mem)
Definition: rt_context.c:186
struct _rti_warp_arg_t::@12 src
GDALDriverH drv
Definition: rt_warp.c:45
struct _rti_warp_arg_t::@12 dst
void * transform
Definition: rt_warp.c:60
Here is the call graph for this function:
Here is the caller graph for this function: