diff --git a/mdflib/src/mdfwriter.cpp b/mdflib/src/mdfwriter.cpp index 27aa02e..aa67b86 100644 --- a/mdflib/src/mdfwriter.cpp +++ b/mdflib/src/mdfwriter.cpp @@ -461,7 +461,14 @@ void MdfWriter::SaveQueue(std::unique_lock& lock) { lock.lock(); } + // Update channel group headers to reflect the new number of samples lock.unlock(); + for (const auto& cg3 : dg3->Cg3()) { + if (cg3 != nullptr) { + cg3->Write(file); + } + } + fclose(file); lock.lock(); } @@ -970,4 +977,4 @@ void MdfWriter::CreateCanOverloadFrameChannel(IChannelGroup& group) { } -} // namespace mdf \ No newline at end of file +} // namespace mdf