diff options
| author | Michael Brasser <michael.brasser@nokia.com> | 2011-05-31 14:26:11 +1000 |
|---|---|---|
| committer | Michael Brasser <michael.brasser@nokia.com> | 2011-05-31 14:26:11 +1000 |
| commit | 163b4b8310af7aaa994246cbcdab8ac2618f316d (patch) | |
| tree | a61892bcdefbef358b0ef1271bae3f1b31e09979 | |
| parent | b70d04a9be05a74c21ec109d2ee921f80edf7b5e (diff) | |
Fix another crash in clear().
| -rw-r--r-- | qobjectlistmodel.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/qobjectlistmodel.cpp b/qobjectlistmodel.cpp index 4ba7d3f..899a0a1 100644 --- a/qobjectlistmodel.cpp +++ b/qobjectlistmodel.cpp @@ -270,6 +270,9 @@ QObject *QObjectListModel::takeAt(int i) */ void QObjectListModel::clear() { + if (m_objects.isEmpty()) + return; + beginRemoveRows(QModelIndex(), 0, m_objects.count() - 1); m_objects.clear(); endRemoveRows(); |
