File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1288,9 +1288,16 @@ void Series::flushFileBased(
12881288 bool flushIOHandler)
12891289{
12901290 auto &series = get ();
1291- if (end == begin)
1291+ /*
1292+ * Iterations might have been present, but have been closed and deleted from
1293+ * internal structures. In this case, previous flushes were successful and
1294+ * the Series is now in written() state.
1295+ */
1296+ if (end == begin && !written ())
1297+ {
12921298 throw std::runtime_error (
12931299 " fileBased output can not be written with no iterations." );
1300+ }
12941301
12951302 switch (IOHandler ()->m_frontendAccess )
12961303 {
Original file line number Diff line number Diff line change @@ -648,6 +648,8 @@ std::optional<StatefulIterator *> StatefulIterator::loopBody(Seek const &seek)
648648 else if (
649649 series.IOHandler ()->m_frontendAccess == Access::READ_LINEAR)
650650 {
651+ std::cout << " Closing Iteration " << *maybe_current_iteration
652+ << std::endl;
651653 data.series .iterations .container ().erase (
652654 *maybe_current_iteration);
653655 }
You can’t perform that action at this time.
0 commit comments