PropagateUpload: The PUTJob owns the chunk device, so make it a QScopedPointer instead of a QSharedPointer

This commit is contained in:
Olivier Goffart 2015-01-14 11:16:54 +01:00
parent 9b7e6cc5c1
commit 7f1593c5d7
2 changed files with 2 additions and 3 deletions

View file

@ -195,14 +195,13 @@ void PropagateUploadFileQNAM::start()
}
UploadDevice::UploadDevice(QIODevice *file, qint64 start, qint64 size, BandwidthManager *bwm)
: QIODevice(file), _file(file), _read(0), _size(size), _start(start),
: _file(file), _read(0), _size(size), _start(start),
_bandwidthManager(bwm),
_bandwidthQuota(0),
_readWithProgress(0),
_bandwidthLimited(false), _choked(false)
{
_bandwidthManager->registerUploadDevice(this);
_file = QPointer<QIODevice>(file);
}

View file

@ -59,7 +59,7 @@ protected slots:
class PUTFileJob : public AbstractNetworkJob {
Q_OBJECT
QSharedPointer<QIODevice> _device;
QScopedPointer<QIODevice> _device;
QMap<QByteArray, QByteArray> _headers;
QString _errorString;