Skip to content

Commit 09b8a70

Browse files
committed
Bug fix: Don't forget closing files
1 parent e3fb9e6 commit 09b8a70

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

src/Series.cpp

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -604,14 +604,19 @@ SeriesInterface::flushFileBased( iterations_iterator begin, iterations_iterator
604604
switch( openIterationIfDirty( it->first, it->second ) )
605605
{
606606
using IO = IterationOpened;
607+
case IO::RemainsClosed:
608+
// we might need to proceed further if the close status is
609+
// ClosedInFrontend
610+
// hence no continue here
611+
// otherwise, we might forget to close files physically
612+
break;
607613
case IO::HasBeenOpened:
614+
// continue below
608615
it->second.flush();
609616
break;
610-
case IO::RemainsClosed:
611-
break;
612617
}
613618

614-
// Phase 2
619+
615620
if( *it->second.m_closed ==
616621
Iteration::CloseStatus::ClosedInFrontend )
617622
{
@@ -687,14 +692,17 @@ SeriesInterface::flushGorVBased( iterations_iterator begin, iterations_iterator
687692
switch( openIterationIfDirty( it->first, it->second ) )
688693
{
689694
using IO = IterationOpened;
695+
case IO::RemainsClosed:
696+
// we might need to proceed further if the close status is
697+
// ClosedInFrontend
698+
// hence no continue here
699+
break;
690700
case IO::HasBeenOpened:
701+
// continue below
691702
it->second.flush();
692703
break;
693-
case IO::RemainsClosed:
694-
break;
695704
}
696705

697-
// Phase 2
698706
if( *it->second.m_closed ==
699707
Iteration::CloseStatus::ClosedInFrontend )
700708
{

0 commit comments

Comments
 (0)