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:
parent
04352cce3c
commit
de8c3158fe
@ -84,10 +84,7 @@ class deleteThread : public QThread {
|
||||
abort = true;
|
||||
condition.wakeOne();
|
||||
mutex.unlock();
|
||||
subDeleteThread *st;
|
||||
foreach(st, subThreads){
|
||||
delete st;
|
||||
}
|
||||
qDeleteAll(subThreads);
|
||||
wait();
|
||||
}
|
||||
|
||||
|
@ -154,10 +154,7 @@ class downloadThread : public QThread {
|
||||
abort = true;
|
||||
condition.wakeOne();
|
||||
mutex.unlock();
|
||||
subDownloadThread *st;
|
||||
foreach(st, subThreads){
|
||||
delete st;
|
||||
}
|
||||
qDeleteAll(subThreads);
|
||||
wait();
|
||||
}
|
||||
|
||||
|
16
src/rss.h
16
src/rss.h
@ -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();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user