Skip to content

Commit e66cb02

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

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
@@ -57,23 +57,7 @@ JSONIOHandlerImpl::JSONIOHandlerImpl(AbstractIOHandler *handler)
5757
: AbstractIOHandlerImpl(handler)
5858
{}
5959

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

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

0 commit comments

Comments
 (0)