Skip to content

Commit f950916

Browse files
committed
Bug fix in RecordComponent::flush
1 parent 5a359b7 commit f950916

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

src/RecordComponent.cpp

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -487,13 +487,17 @@ void RecordComponent::flush(
487487
{
488488
return;
489489
}
490-
if (access::readOnly(IOHandler()->m_frontendAccess) &&
491-
flush_level::global_flushpoint(flushParams.flushLevel))
490+
if (access::readOnly(IOHandler()->m_frontendAccess))
492491
{
493-
while (!rc.m_chunks.empty())
492+
// sic! this needs to be a separate if term, otherwise flushes may
493+
// wrongly jump into the write branch below
494+
if (flush_level::global_flushpoint(flushParams.flushLevel))
494495
{
495-
IOHandler()->enqueue(rc.m_chunks.front());
496-
rc.m_chunks.pop();
496+
while (!rc.m_chunks.empty())
497+
{
498+
IOHandler()->enqueue(rc.m_chunks.front());
499+
rc.m_chunks.pop();
500+
}
497501
}
498502
}
499503
else

0 commit comments

Comments
 (0)