From 7ed0488a1eb7608062c623568fffbbbb3899b387 Mon Sep 17 00:00:00 2001 From: Michael Sumner Date: Thu, 6 Jun 2024 01:21:48 +0000 Subject: [PATCH] try object syntax --- inst/include/gdallibrary/gdallibrary.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/inst/include/gdallibrary/gdallibrary.h b/inst/include/gdallibrary/gdallibrary.h index 635b922..0121f77 100644 --- a/inst/include/gdallibrary/gdallibrary.h +++ b/inst/include/gdallibrary/gdallibrary.h @@ -658,14 +658,14 @@ inline List gdal_read_geometry(CharacterVector dsn, inline CharacterVector gdal_proj_to_wkt(CharacterVector proj_str) { - OGRSpatialReference *oSRS = nullptr; - oSRS = new OGRSpatialReference; + OGRSpatialReference oSRS; + //oSRS = new OGRSpatialReference; char *pszWKT = NULL; - oSRS->SetFromUserInput(proj_str[0]); - oSRS->exportToWkt(&pszWKT); + oSRS.SetFromUserInput(proj_str[0]); + oSRS.exportToWkt(&pszWKT); CharacterVector out = Rcpp::CharacterVector::create(pszWKT); CPLFree(pszWKT); - if (oSRS != nullptr) delete oSRS; + //if (oSRS != nullptr) delete oSRS; return out; }