QDeclarativeTypeLoader doesn't close processed QNetworkReplies
authorFrantisek Vacek <fvacek@blackberry.com>
Mon, 10 Feb 2014 10:12:05 +0000 (11:12 +0100)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Tue, 11 Feb 2014 19:39:40 +0000 (20:39 +0100)
commit763f4e54a818f31b4e89c99ec10924b2738f5de6
tree0120b094ac984f751f35f1c94940e4a053925ce9
parent11100f235e8121af75b15a6946d66ec9a577c779
QDeclarativeTypeLoader doesn't close processed QNetworkReplies

backport of Qt5 patch https://codereview.qt-project.org/#change,76825

This bug causes that Cascades QML application cannot open more than
system ulimit defined number of different asset:///*.qml files.

The realFile is ordinary closed in the ~QNetworkReplyFileImpl(),
the QDeclarativeTypeLoader::networkReplyFinished() calls
reply->deleteLater(). There are tricky situations when event-loop is
not entered and too many read already files are waiting for close.

This patch close() file when all the data is read. It can be done
this way since the QNetworkReplyFileImplnetworkreply is a sequential
device.

For more info, please, read comments on QTBUG-36032

cherry-pick from: qtbase cc88e6e92c806def34bce8cdcab275934ab646bf

Task-number: QTBUG-36032
Change-Id: I896cf9a89c541d743db1ccc11ab853219d844884
Reviewed-by: Richard J. Moore <rich@kde.org>
src/network/access/qnetworkreplyfileimpl.cpp