diff --git a/src/logging/writers/Ascii.cc b/src/logging/writers/Ascii.cc index a0d4504d64..3bc4ef4b38 100644 --- a/src/logging/writers/Ascii.cc +++ b/src/logging/writers/Ascii.cc @@ -52,12 +52,6 @@ Ascii::Ascii(WriterFrontend* frontend) : WriterBackend(frontend) Ascii::~Ascii() { - if ( ! ascii_done ) - { - fprintf(stderr, "missing finish message\n"); - abort(); - } - // Normally, the file will be closed here already via the Finish() // message. But when we terminate abnormally, we may still have it // open. @@ -170,6 +164,7 @@ bool Ascii::DoFinish(double network_time) } ascii_done = true; + CloseFile(network_time); return true; } diff --git a/src/threading/MsgThread.cc b/src/threading/MsgThread.cc index e4cda1e84d..45fbf6afa5 100644 --- a/src/threading/MsgThread.cc +++ b/src/threading/MsgThread.cc @@ -175,6 +175,8 @@ void MsgThread::OnStop() usleep(1000); } + Finished(); + // One more message to make sure the current queue read operation unblocks. SendIn(new UnblockMessage(this), true); }