Skip to content

Commit

Permalink
Merge pull request #91 from ihedvall/tiagoporsch-patch-2
Browse files Browse the repository at this point in the history
Save channel group headers right after saving data
  • Loading branch information
tiagoporsch authored Jun 25, 2024
2 parents 6ec9ebd + a3c7247 commit fdaa8b4
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion mdflib/src/mdfwriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,14 @@ void MdfWriter::SaveQueue(std::unique_lock<std::mutex>& 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();
}
Expand Down Expand Up @@ -970,4 +977,4 @@ void MdfWriter::CreateCanOverloadFrameChannel(IChannelGroup& group) {

}

} // namespace mdf
} // namespace mdf

0 comments on commit fdaa8b4

Please sign in to comment.