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 c7662c9 commit 1645d27
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 @@ -58,23 +58,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 1645d27

Please sign in to comment.