diff --git a/chatlistmodel.h b/chatlistmodel.h index 1242cbba..d5ad10ce 100644 --- a/chatlistmodel.h +++ b/chatlistmodel.h @@ -78,8 +78,12 @@ public: return; } - const bool chatIsCurrent = chat == m_currentChat; emit disconnectChat(chat); + if (chat == m_newChat) { + m_newChat->disconnect(this); + m_newChat = nullptr; + } + const int index = m_chats.indexOf(chat); if (m_chats.count() < 2) { addChat();