mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-20 13:23:34 -07:00
- Make use of qDeleteAll() function from Qt4
This commit is contained in:
parent
04352cce3c
commit
de8c3158fe
3 changed files with 6 additions and 20 deletions
|
@ -84,10 +84,7 @@ class deleteThread : public QThread {
|
||||||
abort = true;
|
abort = true;
|
||||||
condition.wakeOne();
|
condition.wakeOne();
|
||||||
mutex.unlock();
|
mutex.unlock();
|
||||||
subDeleteThread *st;
|
qDeleteAll(subThreads);
|
||||||
foreach(st, subThreads){
|
|
||||||
delete st;
|
|
||||||
}
|
|
||||||
wait();
|
wait();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -154,10 +154,7 @@ class downloadThread : public QThread {
|
||||||
abort = true;
|
abort = true;
|
||||||
condition.wakeOne();
|
condition.wakeOne();
|
||||||
mutex.unlock();
|
mutex.unlock();
|
||||||
subDownloadThread *st;
|
qDeleteAll(subThreads);
|
||||||
foreach(st, subThreads){
|
|
||||||
delete st;
|
|
||||||
}
|
|
||||||
wait();
|
wait();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
16
src/rss.h
16
src/rss.h
|
@ -170,10 +170,8 @@ class RssStream : public QObject{
|
||||||
|
|
||||||
// delete all the items saved
|
// delete all the items saved
|
||||||
void removeAllItems() {
|
void removeAllItems() {
|
||||||
unsigned int listSize = listItem.size();
|
qDeleteAll(listItem);
|
||||||
for(unsigned int i=0; i<listSize; ++i){
|
listItem.clear();
|
||||||
delete listItem.at(i);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void setLoading(bool val) {
|
void setLoading(bool val) {
|
||||||
|
@ -466,10 +464,7 @@ class RssManager : public QObject{
|
||||||
}
|
}
|
||||||
|
|
||||||
~RssManager(){
|
~RssManager(){
|
||||||
RssStream *stream;
|
qDeleteAll(streams);
|
||||||
foreach(stream, streams){
|
|
||||||
delete stream;
|
|
||||||
}
|
|
||||||
delete downloader;
|
delete downloader;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -560,10 +555,7 @@ class RssManager : public QObject{
|
||||||
|
|
||||||
// remove all the streams in the manager
|
// remove all the streams in the manager
|
||||||
void removeAll(){
|
void removeAll(){
|
||||||
RssStream *stream;
|
qDeleteAll(streams);
|
||||||
foreach(stream, streams){
|
|
||||||
delete stream;
|
|
||||||
}
|
|
||||||
streams.clear();
|
streams.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue