Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.2.8, 6.5.1, 6.6, 6.7, 6.8, 6.9
-
None
Description
When cache files are expired, existing open file descriptors to those files are not removed, causing a leak of file descriptors.
This was initially reported and fixed as QTBUG-36076, but the issue was re-introduced in QTBUG-111397. More specifically, commit e5f295c8a removes the following lines in QNetworkDiskCache::expire:
- if (cached.path.contains(PREPARED_SLASH)) { - auto matchesCacheItem = [&cached](QCacheItem *item) { - return item && item->file && item->file->fileName() == cached.path; - }; - auto itemIt = std::find_if(d->inserting.cbegin(), d->inserting.cend(), matchesCacheItem); - if (itemIt != d->inserting.cend()) { - auto &tempfile = (*itemIt)->file; - delete tempfile; - tempfile = nullptr; - } - }
which were responsible for avoiding the leak.