Skip to content

Commit c854fd7

Browse files
committed
Don't flush in JSONIOHandlerImpl destructor
This makes error recovery easier, and is not needed anyway.
1 parent 8c99f44 commit c854fd7

File tree

1 file changed

+1
-17
lines changed

1 file changed

+1
-17
lines changed

src/IO/JSON/JSONIOHandlerImpl.cpp

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -58,23 +58,7 @@ JSONIOHandlerImpl::JSONIOHandlerImpl(AbstractIOHandler *handler)
5858
: AbstractIOHandlerImpl(handler)
5959
{}
6060

61-
JSONIOHandlerImpl::~JSONIOHandlerImpl()
62-
{
63-
// we must not throw in a destructor
64-
try
65-
{
66-
flush();
67-
}
68-
catch (std::exception const &ex)
69-
{
70-
std::cerr << "[~JSONIOHandlerImpl] An error occurred: " << ex.what()
71-
<< std::endl;
72-
}
73-
catch (...)
74-
{
75-
std::cerr << "[~JSONIOHandlerImpl] An error occurred." << std::endl;
76-
}
77-
}
61+
JSONIOHandlerImpl::~JSONIOHandlerImpl() = default;
7862

7963
std::future<void> JSONIOHandlerImpl::flush()
8064
{

0 commit comments

Comments
 (0)