From c0bc479d06751878d4763b8ce796cba94d973c72 Mon Sep 17 00:00:00 2001 From: kyle-basis Date: Wed, 25 Sep 2024 08:26:15 -0700 Subject: [PATCH] Don't clear channels on writer close() (#1194) Don't clear channels on writer close(). This matches the behavior schemas has, allowing for stable ids after closing and opening a new file with the same reader. See https://foxglove.slack.com/archives/C02H1JXG3C3/p1720827358364829?thread_ts=1720825408.044619&cid=C02H1JXG3C3 Alternatives to this involve more bookkeeping on the recorder implementation side to re-register all schemas/channels on split. --- cpp/mcap/include/mcap/writer.inl | 1 - 1 file changed, 1 deletion(-) diff --git a/cpp/mcap/include/mcap/writer.inl b/cpp/mcap/include/mcap/writer.inl index a99333aa2f..08465500a8 100644 --- a/cpp/mcap/include/mcap/writer.inl +++ b/cpp/mcap/include/mcap/writer.inl @@ -473,7 +473,6 @@ void McapWriter::terminate() { zstdChunk_.reset(); #endif - channels_.clear(); attachmentIndex_.clear(); metadataIndex_.clear(); chunkIndex_.clear();