static void destroy_factory_func(RGeo_FactoryData* data) { GEOSContextHandle_t context; context = data->geos_context; if (data->wkt_reader) { GEOSWKTReader_destroy_r(context, data->wkt_reader); } if (data->wkb_reader) { GEOSWKBReader_destroy_r(context, data->wkb_reader); } if (data->wkt_writer) { GEOSWKTWriter_destroy_r(context, data->wkt_writer); } if (data->wkb_writer) { GEOSWKBWriter_destroy_r(context, data->wkb_writer); } if (data->psych_wkt_reader) { GEOSWKTReader_destroy_r(context, data->psych_wkt_reader); } if (data->marshal_wkb_reader) { GEOSWKBReader_destroy_r(context, data->marshal_wkb_reader); } if (data->psych_wkt_writer) { GEOSWKTWriter_destroy_r(context, data->psych_wkt_writer); } if (data->marshal_wkb_writer) { GEOSWKBWriter_destroy_r(context, data->marshal_wkb_writer); } finishGEOS_r(context); free(data); }
SEXP rgeos_finish(SEXP env) { GEOSContextHandle_t r = getContextHandle(env); finishGEOS_r(r); SEXP sxpHandle = findVarInFrame(env, install("GEOSptr")); rgeos_finish_handle(sxpHandle); return(R_NilValue); }
void Crop::done(PointContext ctx) { #ifdef PDAL_HAVE_GEOS if (m_geosPreparedGeometry) GEOSPreparedGeom_destroy_r(m_geosEnvironment, m_geosPreparedGeometry); if (m_geosGeometry) GEOSGeom_destroy_r(m_geosEnvironment, m_geosGeometry); if (m_geosEnvironment) finishGEOS_r(m_geosEnvironment); #endif }
void geom_geos_destroy(geos_handle_t *geos) { if (!geos) { return; } #if GPKG_GEOM_FUNC == GPKG_GEOS finishGEOS_r(geos); #else geos->api.finishGEOS_r(geos->context); dynlib_close(geos->geos_lib); sqlite3_free(geos); #endif }
~test_capigeosgeom_create_data() { GEOSGeom_destroy(geom1_); geom1_ = 0; finishGEOS_r(handle_); }
SPATIALITE_PRIVATE void free_internal_cache (struct splite_internal_cache *cache) { /* freeing an internal cache */ struct splite_geos_cache_item *p; #ifndef OMIT_GEOS GEOSContextHandle_t handle = NULL; #endif #ifdef ENABLE_LIBXML2 int i; struct splite_xmlSchema_cache_item *p_xmlSchema; #endif if (cache == NULL) return; if (cache->magic1 != SPATIALITE_CACHE_MAGIC1 || cache->magic2 != SPATIALITE_CACHE_MAGIC2) return; #ifndef OMIT_GEOS handle = cache->GEOS_handle; if (handle != NULL) finishGEOS_r (handle); cache->GEOS_handle = NULL; gaiaResetGeosMsg_r (cache); #endif #ifndef OMIT_PROJ if (cache->PROJ_handle != NULL) pj_ctx_free (cache->PROJ_handle); cache->PROJ_handle = NULL; #endif /* freeing GEOS error buffers */ if (cache->gaia_geos_error_msg) free (cache->gaia_geos_error_msg); if (cache->gaia_geos_warning_msg) free (cache->gaia_geos_warning_msg); if (cache->gaia_geosaux_error_msg) free (cache->gaia_geosaux_error_msg); /* freeing the XML error buffers */ gaiaOutBufferReset (cache->xmlParsingErrors); gaiaOutBufferReset (cache->xmlSchemaValidationErrors); gaiaOutBufferReset (cache->xmlXPathErrors); free (cache->xmlParsingErrors); free (cache->xmlSchemaValidationErrors); free (cache->xmlXPathErrors); /* freeing the GEOS cache */ p = &(cache->cacheItem1); splite_free_geos_cache_item_r (cache, p); p = &(cache->cacheItem2); splite_free_geos_cache_item_r (cache, p); #ifdef ENABLE_LIBXML2 for (i = 0; i < MAX_XMLSCHEMA_CACHE; i++) { /* freeing the XmlSchema cache */ p_xmlSchema = &(cache->xmlSchemaCache[i]); splite_free_xml_schema_cache_item (p_xmlSchema); } #endif if (cache->cutterMessage != NULL) sqlite3_free (cache->cutterMessage); cache->cutterMessage = NULL; spatialite_finalize_topologies (cache); #ifndef GEOS_REENTRANT /* only partially thread-safe mode */ /* releasing the connection pool object */ invalidate (cache->pool_index); #endif /* end GEOS_REENTRANT */ /* freeing the cache itself */ free (cache); }