mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-04-28 11:56:20 +00:00
feat(CoreManager): add a assert in getChatModel to check if a chat room was correctly removed
This commit is contained in:
parent
275960f869
commit
ebf1d8da84
1 changed files with 3 additions and 2 deletions
|
|
@ -120,7 +120,8 @@ shared_ptr<ChatModel> CoreManager::getChatModel (const QString &peerAddress, con
|
|||
Q_ASSERT(mCore->createAddress(Utils::appStringToCoreString(localAddress)));
|
||||
|
||||
auto deleter = [this, chatModelId](ChatModel *chatModel) {
|
||||
mChatModels.remove(chatModelId);
|
||||
bool removed = mChatModels.remove(chatModelId);
|
||||
Q_ASSERT(removed);
|
||||
delete chatModel;
|
||||
};
|
||||
|
||||
|
|
@ -134,7 +135,7 @@ shared_ptr<ChatModel> CoreManager::getChatModel (const QString &peerAddress, con
|
|||
|
||||
// Returns an existing chat model.
|
||||
shared_ptr<ChatModel> chatModel = mChatModels[chatModelId].lock();
|
||||
Q_CHECK_PTR(chatModel.get());
|
||||
Q_CHECK_PTR(chatModel);
|
||||
return chatModel;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue