fix(CoreManager): avoid memory leak on ChatModel and use correct sip address key*

This commit is contained in:
nicolas 2017-09-07 12:26:49 +02:00
parent 922723fdfc
commit 12c06a0324

View file

@ -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);