Merge pull request #12259 from Chocobo1/dtor

Rely on Qt ownership to free resources
This commit is contained in:
Mike Tzou 2020-03-27 01:06:39 +08:00 committed by GitHub
commit c0b0c6dcfc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 6 deletions

View file

@ -64,11 +64,6 @@ DownloadHandlerImpl::DownloadHandlerImpl(Net::DownloadManager *manager, const Ne
m_result.status = Net::DownloadStatus::Success;
}
DownloadHandlerImpl::~DownloadHandlerImpl()
{
delete m_reply;
}
void DownloadHandlerImpl::cancel()
{
if (m_reply) {
@ -83,6 +78,7 @@ void DownloadHandlerImpl::cancel()
void DownloadHandlerImpl::assignNetworkReply(QNetworkReply *reply)
{
Q_ASSERT(reply);
Q_ASSERT(!m_reply);
m_reply = reply;
m_reply->setParent(this);

View file

@ -43,7 +43,6 @@ class DownloadHandlerImpl : public Net::DownloadHandler
public:
DownloadHandlerImpl(Net::DownloadManager *manager, const Net::DownloadRequest &downloadRequest);
~DownloadHandlerImpl() override;
void cancel() override;