Fix many memory leaks.

This commit is contained in:
Petr Mrázek
2014-03-30 20:11:05 +02:00
parent e1e1d99102
commit fbc29b6a06
35 changed files with 139 additions and 103 deletions

View File

@ -26,7 +26,7 @@ public:
{
return ByteArrayDownloadPtr(new ByteArrayDownload(url));
}
virtual ~ByteArrayDownload() {};
public:
/// if not saving to file, downloaded data is placed here
QByteArray m_data;

View File

@ -41,6 +41,7 @@ public:
{
return CacheDownloadPtr(new CacheDownload(url, entry));
}
virtual ~CacheDownload(){};
QString getTargetFilepath()
{
return m_target_path;

View File

@ -39,7 +39,7 @@ public:
{
return ForgeMirrorsPtr(new ForgeMirrors(libs, parent_job, mirrorlist));
}
virtual ~ForgeMirrors(){};
protected
slots:
virtual void downloadProgress(qint64 bytesReceived, qint64 bytesTotal);

View File

@ -45,6 +45,7 @@ public:
{
return ForgeXzDownloadPtr(new ForgeXzDownload(relative_path, entry));
}
virtual ~ForgeXzDownload(){};
void setMirrors(QList<ForgeMirror> & mirrors);
protected

View File

@ -38,6 +38,7 @@ public:
{
return Md5EtagDownloadPtr(new MD5EtagDownload(url, target_path));
}
virtual ~MD5EtagDownload(){};
protected
slots:
virtual void downloadProgress(qint64 bytesReceived, qint64 bytesTotal);

View File

@ -32,7 +32,7 @@ class NetJob : public ProgressProvider
Q_OBJECT
public:
explicit NetJob(QString job_name) : ProgressProvider(), m_job_name(job_name) {};
virtual ~NetJob() {};
template <typename T> bool addNetAction(T action)
{
NetActionPtr base = std::static_pointer_cast<NetAction>(action);

View File

@ -9,6 +9,7 @@ class PasteUpload : public Task
Q_OBJECT
public:
PasteUpload(QWidget *window, QString text);
virtual ~PasteUpload(){};
protected:
virtual void executeTask();