summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlli Salli <ollisal@gmail.com>2010-11-18 19:19:50 (GMT)
committerOlli Salli <ollisal@gmail.com>2010-11-18 19:43:04 (GMT)
commit63633814a67d0fc47fcdf5443e6329d95b3c29b4 (patch)
tree16d4765a0fbb45b35a3ab629d200ea7197dfcec9
parenta723e2945ac43ac8338ba0507dad0f2e40c46bd3 (diff)
downloadtelepathy-qt4-63633814a67d0fc47fcdf5443e6329d95b3c29b4.tar.gz
telepathy-qt4-63633814a67d0fc47fcdf5443e6329d95b3c29b4.tar.xz
Fix crash using dangling (const!) iterator after remove in Conference code
Reviewed-by: Will Thompson (wjt) <will.thompson@collabora.co.uk>
-rw-r--r--TelepathyQt4/channel.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/TelepathyQt4/channel.cpp b/TelepathyQt4/channel.cpp
index fc4f3c7..2a6f956 100644
--- a/TelepathyQt4/channel.cpp
+++ b/TelepathyQt4/channel.cpp
@@ -3489,10 +3489,12 @@ void Channel::gotConferenceChannelRemovedActorContact(PendingOperation *op)
emit conferenceChannelRemoved(channel, GroupMemberChangeDetails(actorContact,
info->details));
- for (QHash<uint, ChannelPtr>::const_iterator i = mPriv->conferenceOriginalChannels.constBegin();
- i != mPriv->conferenceOriginalChannels.constEnd(); ++i) {
+ for (QHash<uint, ChannelPtr>::iterator i = mPriv->conferenceOriginalChannels.begin();
+ i != mPriv->conferenceOriginalChannels.end();) {
if (i.value() == channel) {
- mPriv->conferenceOriginalChannels.remove(i.key());
+ i = mPriv->conferenceOriginalChannels.erase(i);
+ } else {
+ ++i;
}
}