summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2013-10-01 17:18:05 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2013-10-01 17:18:05 +0200
commit209965bea3db4006eed27939619f4e228ec500ca (patch)
treea957e1486af7ff5659910e68ec50641d514becf6 /src
parenta5d271dd8f3c2726aa42929c923704f98ad37010 (diff)
Make sure that the skipped messages are the old ones and not the new one.
Diffstat (limited to 'src')
-rw-r--r--src/messagehandler.cc8
1 files 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();
}
}