summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGluzskiy Alexandr <sss@sss.chaoslab.ru>2011-10-12 17:15:35 +0300
committerGluzskiy Alexandr <sss@sss.chaoslab.ru>2011-10-12 17:15:35 +0300
commit16c7f7b357556eb8c38a3b265fbed5e67ac77789 (patch)
treef7223096c56bf052d21148331a0e38e9bf93c186
parent4df8492d1da4ce2d4fb075221c0baf79e91f1734 (diff)
modified: utilities.cpp
-rwxr-xr-xutilities.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/utilities.cpp b/utilities.cpp
index b066e22..83e13da 100755
--- a/utilities.cpp
+++ b/utilities.cpp
@@ -446,10 +446,14 @@ int onProtoAck(WPARAM w, LPARAM l)
else if(ack->type == ACKTYPE_MESSAGE && ack->result == ACKRESULT_FAILED)
{
extern std::list<HANDLE> sent_msgs;
- std::list<HANDLE>::iterator it = std::find(sent_msgs.begin(), sent_msgs.end(), ack->hProcess);
- if(it != sent_msgs.end())
+ if(!sent_msgs.empty())
{
- HistoryLog(ack->hContact, db_event("Failed to send encrypted message", 0,0, 0));
+ std::list<HANDLE>::iterator it = std::find(sent_msgs.begin(), sent_msgs.end(), ack->hProcess);
+ if(it != sent_msgs.end())
+ {
+ HistoryLog(ack->hContact, db_event("Failed to send encrypted message", 0,0, 0));
+ sent_msgs.erase(it);
+ }
}
}
return 0;