Skip to content

Commit 0d9a9a4

Browse files
committed
Bug fix: Don't forget closing files
1 parent 9ff726a commit 0d9a9a4

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

src/Series.cpp

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -551,13 +551,17 @@ SeriesInterface::flushFileBased( iterations_iterator begin, iterations_iterator
551551
{
552552
using IO = IterationOpened;
553553
case IO::RemainsClosed:
554-
continue;
554+
// we might need to proceed further if the close status is
555+
// ClosedInFrontend
556+
// hence no continue here
557+
// otherwise, we might forget to close files physically
558+
break;
555559
case IO::HasBeenOpened:
556560
// continue below
561+
it->second.flush();
557562
break;
558563
}
559564

560-
it->second.flush();
561565

562566
if( *it->second.m_closed ==
563567
Iteration::CloseStatus::ClosedInFrontend )
@@ -629,13 +633,16 @@ SeriesInterface::flushGorVBased( iterations_iterator begin, iterations_iterator
629633
{
630634
using IO = IterationOpened;
631635
case IO::RemainsClosed:
632-
continue;
636+
// we might need to proceed further if the close status is
637+
// ClosedInFrontend
638+
// hence no continue here
639+
break;
633640
case IO::HasBeenOpened:
634641
// continue below
642+
it->second.flush();
635643
break;
636644
}
637645

638-
it->second.flush();
639646
if( *it->second.m_closed ==
640647
Iteration::CloseStatus::ClosedInFrontend )
641648
{

0 commit comments

Comments
 (0)