mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-02-07 14:18:25 +00:00
fix(core-chat-room): add a workaround to deal with destroyed chat rooms
This commit is contained in:
parent
37011a2737
commit
5c635ab5c2
1 changed files with 12 additions and 2 deletions
|
|
@ -254,8 +254,18 @@ void Core::deleteChatRoom (const shared_ptr<const AbstractChatRoom> &chatRoom) {
|
|||
const ChatRoomId &chatRoomId = chatRoom->getChatRoomId();
|
||||
auto it = d->chatRoomsById.find(chatRoomId);
|
||||
if (it != d->chatRoomsById.end()) {
|
||||
auto it = find(d->chatRooms.begin(), d->chatRooms.end(), chatRoom);
|
||||
L_ASSERT(it != d->chatRooms.end());
|
||||
|
||||
// TODO: Remove me later.
|
||||
auto it = find_if(
|
||||
d->chatRooms.begin(), d->chatRooms.end(),
|
||||
[&chatRoomId](const shared_ptr<AbstractChatRoom> &chatRoom) {
|
||||
return chatRoom->getChatRoomId() == chatRoomId;
|
||||
}
|
||||
);
|
||||
|
||||
// FIXME: Use this code in the future. (Wait for signals.)
|
||||
// auto it = find(d->chatRooms.begin(), d->chatRooms.end(), chatRoom);
|
||||
// L_ASSERT(it != d->chatRooms.end());
|
||||
d->chatRooms.erase(it);
|
||||
d->mainDb->deleteChatRoom(chatRoomId);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue