Skip to content

Commit

Permalink
Don't flush in JSONIOHandlerImpl destructor
Browse files Browse the repository at this point in the history
This makes error recovery easier, and is not needed anyway.
  • Loading branch information
franzpoeschel committed Jan 4, 2023
1 parent 00c8383 commit 860217a
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions src/IO/JSON/JSONIOHandlerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,23 +57,7 @@ JSONIOHandlerImpl::JSONIOHandlerImpl(AbstractIOHandler *handler)
: AbstractIOHandlerImpl(handler)
{}

JSONIOHandlerImpl::~JSONIOHandlerImpl()
{
// we must not throw in a destructor
try
{
flush();
}
catch (std::exception const &ex)
{
std::cerr << "[~JSONIOHandlerImpl] An error occurred: " << ex.what()
<< std::endl;
}
catch (...)
{
std::cerr << "[~JSONIOHandlerImpl] An error occurred." << std::endl;
}
}
JSONIOHandlerImpl::~JSONIOHandlerImpl() = default;

std::future<void> JSONIOHandlerImpl::flush()
{
Expand Down

0 comments on commit 860217a

Please sign in to comment.