Skip to content

Commit d40c8ef

Browse files
committed
Make sure we don't get an exception in destructors
1 parent d24f23f commit d40c8ef

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

src/export/export_format_json.hpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,11 @@ class ExportFormatJSON : public ExportFormat {
6666
osmium::io::fsync fsync,
6767
const options_type& options);
6868

69-
~ExportFormatJSON() override {
70-
close();
69+
~ExportFormatJSON() noexcept override {
70+
try {
71+
close();
72+
} catch (...) {
73+
}
7174
}
7275

7376
void node(const osmium::Node& node) override;

src/export/export_format_pg.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class ExportFormatPg : public ExportFormat {
6464
osmium::io::fsync fsync,
6565
const options_type& options);
6666

67-
~ExportFormatPg() override {
67+
~ExportFormatPg() noexcept override {
6868
try {
6969
close();
7070
} catch (...) {

src/export/export_format_text.hpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,11 @@ class ExportFormatText : public ExportFormat {
5353
osmium::io::fsync fsync,
5454
const options_type& options);
5555

56-
~ExportFormatText() override {
57-
close();
56+
~ExportFormatText() noexcept override {
57+
try {
58+
close();
59+
} catch (...) {
60+
}
5861
}
5962

6063
void node(const osmium::Node& node) override;

0 commit comments

Comments
 (0)