Skip to content

Commit

Permalink
do not GDALClose(driver), this is not needed and seems to cause crashes
Browse files Browse the repository at this point in the history
  • Loading branch information
Ylannl committed Feb 29, 2024
1 parent 7a9643f commit 55e7cee
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Map3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ bool Map3d::get_postgis_output(std::string connstr, bool pdok, bool citygml) {
std::cerr << "ERROR: Cannot open database '" + connstr + "' for writing" << std::endl;
dataSource->RollbackTransaction();
GDALClose(dataSource);
GDALClose(driver);
// GDALClose(driver);
return false;
}
layers.emplace(layername, layer);
Expand Down Expand Up @@ -544,7 +544,7 @@ bool Map3d::get_postgis_output(std::string connstr, bool pdok, bool citygml) {
return false;
}
GDALClose(dataSource);
GDALClose(driver);
// GDALClose(driver);
return true;
#endif
}
Expand All @@ -563,14 +563,14 @@ bool Map3d::get_gdal_output(std::string filename, std::string drivername, bool m
if (layer == NULL) {
std::cerr << "ERROR: Cannot open file '" + filename + "' for writing" << std::endl;
GDALClose(layer);
GDALClose(driver);
// GDALClose(driver);
return false;
}
for (auto& f : _lsFeatures) {
f->get_shape(layer, false);
}
GDALClose(layer);
GDALClose(driver);
// GDALClose(driver);
}
else {
std::unordered_map<std::string, OGRLayer*> layers;
Expand Down Expand Up @@ -604,7 +604,7 @@ void Map3d::close_gdal_resources(GDALDriver* driver, std::unordered_map<std::str
for (auto& layer : layers) {
GDALClose(layer.second);
}
GDALClose(driver);
// GDALClose(driver);
}
#endif

Expand Down

0 comments on commit 55e7cee

Please sign in to comment.