From 5a29621141424917810be68cd42afac78f0ea6f6 Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Thu, 29 Jun 2017 16:04:57 +0200 Subject: [PATCH] Fix crash when terminating a call. --- src/components/chat/ChatProxyModel.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/chat/ChatProxyModel.cpp b/src/components/chat/ChatProxyModel.cpp index 83db8b545..696b1d44c 100644 --- a/src/components/chat/ChatProxyModel.cpp +++ b/src/components/chat/ChatProxyModel.cpp @@ -159,9 +159,10 @@ void ChatProxyModel::setSipAddress (const QString &sipAddress) { } mChatModel = CoreManager::getInstance()->getChatModelFromSipAddress(sipAddress); - mChatModel->resetMessagesCount(); if (mChatModel) { + mChatModel->resetMessagesCount(); + ChatModel *chatModel = mChatModel.get(); QObject::connect(chatModel, &ChatModel::isRemoteComposingChanged, this, &ChatProxyModel::handleIsRemoteComposingChanged); QObject::connect(chatModel, &ChatModel::messageReceived, this, &ChatProxyModel::handleMessageReceived);