Better exception safety for SourceFromInputStream.

This commit is contained in:
Nikolai Kochetov 2019-05-15 14:59:13 +03:00
parent b2a3835195
commit f5e20027a7

View File

@ -63,7 +63,20 @@ IProcessor::Status SourceFromInputStream::prepare()
void SourceFromInputStream::work()
{
if (!is_generating_finished)
return ISource::work();
{
try
{
ISource::work();
}
catch (...)
{
/// Won't read suffix in case of exception.
is_stream_finished = true;
throw;
}
return;
}
if (is_stream_finished)
return;