mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-02-01 03:19:23 +00:00
fix(CoreManager): avoid memory leak on ChatModel and use correct sip address key*
This commit is contained in:
parent
922723fdfc
commit
12c06a0324
1 changed files with 2 additions and 1 deletions
|
|
@ -98,10 +98,11 @@ shared_ptr<ChatModel> CoreManager::getChatModelFromSipAddress (const QString &si
|
|||
|
||||
auto deleter = [this](ChatModel *chatModel) {
|
||||
mChatModels.remove(chatModel->getSipAddress());
|
||||
delete chatModel;
|
||||
};
|
||||
|
||||
shared_ptr<ChatModel> chatModel(new ChatModel(sipAddress), deleter);
|
||||
mChatModels[sipAddress] = chatModel;
|
||||
mChatModels[chatModel->getSipAddress()] = chatModel;
|
||||
|
||||
emit chatModelCreated(chatModel);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue