Skip to content

Commit 0a00097

Browse files
committed
Fix segfault when deleting nested channels
1 parent d6fcd65 commit 0a00097

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/caliper/Caliper.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1372,8 +1372,8 @@ void Caliper::finalize()
13721372

13731373
Log(1).stream() << "Finalizing ... " << std::endl;
13741374

1375-
auto channels_copy = sG->all_channels;
1376-
for (auto& channel : channels_copy) {
1375+
while (!sG->all_channels.empty()) {
1376+
auto channel = sG->all_channels.front();
13771377
if (channel.mP->flush_on_exit)
13781378
flush_and_write(&channel, SnapshotView());
13791379
delete_channel(channel);

0 commit comments

Comments
 (0)