Commit e75ebbe4 authored by Andreas Traczyk's avatar Andreas Traczyk

fix crash when closing the application

Change-Id: I87bb9bcc3a3c4951a8d60d24203d9e4b3cff02a7
parent 7e05570f
...@@ -290,6 +290,7 @@ MainWindow::closeEvent(QCloseEvent* event) ...@@ -290,6 +290,7 @@ MainWindow::closeEvent(QCloseEvent* event)
settings.setValue(SettingsKey::geometry, saveGeometry()); settings.setValue(SettingsKey::geometry, saveGeometry());
settings.setValue(SettingsKey::windowState, saveState()); settings.setValue(SettingsKey::windowState, saveState());
} }
this->disconnect(screenChangedConnection_);
LRCInstance::reset(); LRCInstance::reset();
QMainWindow::closeEvent(event); QMainWindow::closeEvent(event);
} }
......
...@@ -40,9 +40,7 @@ SmartListModel::SmartListModel(const lrc::api::account::Info &acc, QObject *pare ...@@ -40,9 +40,7 @@ SmartListModel::SmartListModel(const lrc::api::account::Info &acc, QObject *pare
int SmartListModel::rowCount(const QModelIndex &parent) const int SmartListModel::rowCount(const QModelIndex &parent) const
{ {
if (!parent.isValid()) { if (!parent.isValid()) {
try { return acc_.conversationModel->allFilteredConversations().size();
return acc_.conversationModel->allFilteredConversations().size();
} catch (...) {}
} }
return 0; // A valid QModelIndex returns 0 as no entry has sub-elements return 0; // A valid QModelIndex returns 0 as no entry has sub-elements
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment