From 209965bea3db4006eed27939619f4e228ec500ca Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Tue, 1 Oct 2013 17:18:05 +0200 Subject: Make sure that the skipped messages are the old ones and not the new one. --- src/messagehandler.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/messagehandler.cc b/src/messagehandler.cc index a5a71f1..dcaf5f1 100644 --- a/src/messagehandler.cc +++ b/src/messagehandler.cc @@ -65,12 +65,12 @@ bool MessageHandler::sendMessage(message_receiver_id_t id, Message* msg) MutexAutolock l(mutex); if(receivers.find(id) == receivers.end()) { - WARN(msghandler, "Could not find id %d\n", id); + //WARN(msghandler, "Could not find id %d\n", id); delete msg; return false; } - DEBUG(msghandler, "Sending message to id %d\n", id); + //DEBUG(msghandler, "Sending message to id %d\n", id); MessageReceiver *receiver = receivers[id]; @@ -78,8 +78,8 @@ bool MessageHandler::sendMessage(message_receiver_id_t id, Message* msg) Message *pmsg; while( (pmsg = receiver->peekMessage()) != NULL) { if(pmsg->type() != Message::LoadStatus) break; - delete msg; - msg = receiver->receiveMessage(); + // Remove all old messages with same type. + delete receiver->receiveMessage(); } } -- cgit v1.2.3