Fixed minor memory leak.

This commit is contained in:
hiker 2015-08-01 22:02:00 +10:00
parent 78c592e4e5
commit 2f902f769d

View File

@ -331,12 +331,15 @@ void AddonsLoading::stopDownload()
// (and not uninstalling an installed one): // (and not uninstalling an installed one):
if(m_download_request) if(m_download_request)
{ {
// In case of a cancel we can't free the memory, since // In case of a cancel we can't free the memory, since the
// network_http will potentially update the request. So in // request manager thread is potentially working on this request. So
// order to avoid a memory leak, we let network_http free // in order to avoid a memory leak, we let the request manager
// the request. // free the data. This is thread safe since freeing the data is done
//m_download_request->setManageMemory(true); // when the request manager handles the result queue - and this is
// done by the main thread (i.e. this thread).
m_download_request->setManageMemory(true);
m_download_request->cancel(); m_download_request->cancel();
m_download_request = NULL;
}; };
} // startDownload } // startDownload