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 Nov 17, 2022
1 parent 2647697 commit e66cb02
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 e66cb02

Please sign in to comment.