Skip to content

Commit

Permalink
unset config_options at the end of st_write; #1618
Browse files Browse the repository at this point in the history
  • Loading branch information
edzer committed Mar 31, 2021
1 parent 7974a4d commit 370f934
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# version 0.9-9

* `st_write` gains an argument `config_options` to set GDAL config options; #1618

* fix regression in `sf_project` when `keep = TRUE`; #1635

# version 0.9-8
Expand Down
5 changes: 5 additions & 0 deletions src/gdal_write.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -354,5 +354,10 @@ int CPL_write_ogr(Rcpp::List obj, Rcpp::CharacterVector dsn, Rcpp::CharacterVect
Rcpp::stop("CommitTransaction() failed.\n");
} // #nocov end
GDALClose(poDS);
if (ConfigOptions.size()) {
Rcpp::CharacterVector names = ConfigOptions.attr("names");
for (int i = 0; i < ConfigOptions.size(); i++)
CPLSetConfigOption(names[i], NULL);
}
return 0; // all O.K.
}

0 comments on commit 370f934

Please sign in to comment.