diff --git a/src/threading/MsgThread.cc b/src/threading/MsgThread.cc index b7a8f4922c..48c7253885 100644 --- a/src/threading/MsgThread.cc +++ b/src/threading/MsgThread.cc @@ -342,14 +342,14 @@ void MsgThread::Run() bool result = msg->Process(); + delete msg; + if ( ! result ) { string s = Fmt("%s failed, terminating thread (MsgThread)", Name()); Error(s.c_str()); break; } - - delete msg; } // In case we haven't send the finish method yet, do it now. Reading