mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-19 03:58:08 +00:00
Fixed crash in deleteChatRoom
This commit is contained in:
parent
22986f1840
commit
f276a82f46
1 changed files with 7 additions and 6 deletions
|
|
@ -75,12 +75,13 @@ void CorePrivate::insertChatRoom (const shared_ptr<ChatRoom> &chatRoom) {
|
|||
|
||||
void CorePrivate::deleteChatRoom (const string &peerAddress) {
|
||||
auto it = chatRoomsByUri.find(peerAddress);
|
||||
if (it != chatRoomsByUri.end())
|
||||
chatRooms.erase(
|
||||
find_if(chatRooms.begin(), chatRooms.end(), [&peerAddress](const shared_ptr<const ChatRoom> &chatRoom) {
|
||||
return peerAddress == chatRoom->getPeerAddress().asStringUriOnly();
|
||||
})
|
||||
);
|
||||
if (it != chatRoomsByUri.end()) {
|
||||
auto it = find_if(chatRooms.begin(), chatRooms.end(), [&peerAddress](const shared_ptr<const ChatRoom> &chatRoom) {
|
||||
return peerAddress == chatRoom->getPeerAddress().asStringUriOnly();
|
||||
});
|
||||
if (it == chatRooms.end()) return;
|
||||
chatRooms.erase(it);
|
||||
}
|
||||
}
|
||||
|
||||
void CorePrivate::insertChatRoomWithDb (const shared_ptr<ChatRoom> &chatRoom) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue