From e75ebbe40b70a8e80064f065f4a1c78d80027f9b Mon Sep 17 00:00:00 2001
From: Andreas Traczyk <andreas.traczyk@savoirfairelinux.com>
Date: Thu, 27 Dec 2018 10:03:28 -0500
Subject: [PATCH] fix crash when closing the application

Change-Id: I87bb9bcc3a3c4951a8d60d24203d9e4b3cff02a7
---
 mainwindow.cpp     | 1 +
 smartlistmodel.cpp | 4 +---
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/mainwindow.cpp b/mainwindow.cpp
index efb48b5..74eaa41 100644
--- a/mainwindow.cpp
+++ b/mainwindow.cpp
@@ -290,6 +290,7 @@ MainWindow::closeEvent(QCloseEvent* event)
         settings.setValue(SettingsKey::geometry, saveGeometry());
         settings.setValue(SettingsKey::windowState, saveState());
     }
+    this->disconnect(screenChangedConnection_);
     LRCInstance::reset();
     QMainWindow::closeEvent(event);
 }
diff --git a/smartlistmodel.cpp b/smartlistmodel.cpp
index 03551f9..be10454 100644
--- a/smartlistmodel.cpp
+++ b/smartlistmodel.cpp
@@ -40,9 +40,7 @@ SmartListModel::SmartListModel(const lrc::api::account::Info &acc, QObject *pare
 int SmartListModel::rowCount(const QModelIndex &parent) const
 {
     if (!parent.isValid()) {
-        try {
-            return acc_.conversationModel->allFilteredConversations().size();
-        } catch (...) {}
+        return acc_.conversationModel->allFilteredConversations().size();
     }
     return 0; // A valid QModelIndex returns 0 as no entry has sub-elements
 }
-- 
GitLab