diff options
| author | Frank Reininghaus <[email protected]> | 2013-06-28 21:39:35 +0200 |
|---|---|---|
| committer | Frank Reininghaus <[email protected]> | 2013-06-28 21:39:35 +0200 |
| commit | 7799bf1828b06ccbc1f688a2e4dc1bfa73c7c380 (patch) | |
| tree | 28e6bcdbfab41060e1600b8c1b198cac24dcf152 /src/kitemviews/kfileitemmodel.cpp | |
| parent | 5ca5a8f3b61f74c7857fbfb4522ef27ad89e9a0e (diff) | |
Fix memory leak in KFileItemModel
Since m_pendingItemsToInsert is a list of pointers now (and not a list
of KFileItems, as in the 4.10 branch), we have to delete all pointers
when clearing or destroying the model.
I think that no review request is necessary for this small and obvious
change.
CCMAIL: [email protected]
Diffstat (limited to 'src/kitemviews/kfileitemmodel.cpp')
| -rw-r--r-- | src/kitemviews/kfileitemmodel.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/kitemviews/kfileitemmodel.cpp b/src/kitemviews/kfileitemmodel.cpp index 3f19a2011..d174cf67f 100644 --- a/src/kitemviews/kfileitemmodel.cpp +++ b/src/kitemviews/kfileitemmodel.cpp @@ -114,6 +114,7 @@ KFileItemModel::~KFileItemModel() { qDeleteAll(m_itemData); qDeleteAll(m_filteredItems.values()); + qDeleteAll(m_pendingItemsToInsert); } void KFileItemModel::loadDirectory(const KUrl& url) @@ -941,6 +942,8 @@ void KFileItemModel::slotClear() m_maximumUpdateIntervalTimer->stop(); m_resortAllItemsTimer->stop(); + + qDeleteAll(m_pendingItemsToInsert); m_pendingItemsToInsert.clear(); const int removedCount = m_itemData.count(); |
