Don't crash when leaving an opened room

Should fix #568
This commit is contained in:
Tobias Fella
2023-01-28 20:23:10 +01:00
parent 9d5303113e
commit ebd521e2ee
2 changed files with 3 additions and 2 deletions

View File

@@ -105,7 +105,7 @@ ChatDocumentHandler::ChatDocumentHandler(QObject *parent)
{
connect(this, &ChatDocumentHandler::roomChanged, this, [this]() {
m_completionModel->setRoom(m_room);
static NeoChatRoom *previousRoom = nullptr;
static QPointer<NeoChatRoom> previousRoom = nullptr;
if (previousRoom) {
disconnect(previousRoom, &NeoChatRoom::chatBoxTextChanged, this, nullptr);
}