1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-01-10 14:57:52 +00:00

- Make use of qDeleteAll() function from Qt4

This commit is contained in:
Christophe Dumez 2007-08-19 13:00:51 +00:00
parent 04352cce3c
commit de8c3158fe
3 changed files with 6 additions and 20 deletions

View File

@ -84,10 +84,7 @@ class deleteThread : public QThread {
abort = true;
condition.wakeOne();
mutex.unlock();
subDeleteThread *st;
foreach(st, subThreads){
delete st;
}
qDeleteAll(subThreads);
wait();
}

View File

@ -154,10 +154,7 @@ class downloadThread : public QThread {
abort = true;
condition.wakeOne();
mutex.unlock();
subDownloadThread *st;
foreach(st, subThreads){
delete st;
}
qDeleteAll(subThreads);
wait();
}

View File

@ -170,10 +170,8 @@ class RssStream : public QObject{
// delete all the items saved
void removeAllItems() {
unsigned int listSize = listItem.size();
for(unsigned int i=0; i<listSize; ++i){
delete listItem.at(i);
}
qDeleteAll(listItem);
listItem.clear();
}
void setLoading(bool val) {
@ -466,10 +464,7 @@ class RssManager : public QObject{
}
~RssManager(){
RssStream *stream;
foreach(stream, streams){
delete stream;
}
qDeleteAll(streams);
delete downloader;
}
@ -560,10 +555,7 @@ class RssManager : public QObject{
// remove all the streams in the manager
void removeAll(){
RssStream *stream;
foreach(stream, streams){
delete stream;
}
qDeleteAll(streams);
streams.clear();
}