Skip to content

Commit 82d7e2f

Browse files
committed
comment
1 parent 24bc375 commit 82d7e2f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

cereal/messaging/socketmaster.cc

+2
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@ void SubMaster::update(int timeout) {
102102
m->msg_reader->~FlatArrayMessageReader();
103103
capnp::ReaderOptions options;
104104
options.traversalLimitInWords = kj::maxValue; // Don't limit
105+
106+
// Reset the message buffer to the new one. Keep it for the message reader's lifetime.
105107
m->message.reset(msg);
106108
m->msg_reader = new (m->allocated_msg_reader) capnp::FlatArrayMessageReader(m->aligned_buf.align(msg), options);
107109
messages.push_back({m->name, m->msg_reader->getRoot<cereal::Event>()});

0 commit comments

Comments
 (0)