diff --git a/src/Map3d.cpp b/src/Map3d.cpp index 24b8f07c..29762b71 100644 --- a/src/Map3d.cpp +++ b/src/Map3d.cpp @@ -423,7 +423,7 @@ bool Map3d::get_pdok_output(std::string filename) { OGRLayer *layer = create_gdal_layer(driver, tmpFilename, layername, attributes, f->get_class() == BUILDING); if (layer == NULL) { std::cerr << "ERROR: Cannot open database '" + filename + "' for writing" << std::endl; - close_gdal_resources(driver, layers); + GDALClose(driver); return false; } layers.emplace(layername, layer); @@ -440,7 +440,7 @@ bool Map3d::get_pdok_output(std::string filename) { f->get_shape(layers[layername], true, extraAttribute); } - close_gdal_resources(driver, layers); + GDALClose(driver); return true; #endif } diff --git a/src/main.cpp b/src/main.cpp index 2a9bbbb9..3f2389ce 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -684,6 +684,7 @@ int main(int argc, const char * argv[]) { } else { std::cerr << "ERROR: Writing features failed for " << format << ". Aborting.\n"; + return EXIT_FAILURE; } }