mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-14 14:32:15 -07:00
delete threads
This commit is contained in:
parent
3a42354efd
commit
d7000fbcb0
2 changed files with 1 additions and 11 deletions
|
|
@ -28,16 +28,7 @@ PictureLoaderWorkerWork::PictureLoaderWorkerWork(const PictureLoaderWorker *work
|
|||
// Hook up signals to settings
|
||||
connect(&SettingsCache::instance(), SIGNAL(picDownloadChanged()), this, SLOT(picDownloadChanged()));
|
||||
|
||||
pictureLoaderThread = new QThread;
|
||||
moveToThread(pictureLoaderThread);
|
||||
|
||||
connect(pictureLoaderThread, &QThread::started, this, &PictureLoaderWorkerWork::startNextPicDownload);
|
||||
|
||||
// clean up threads once loading finishes
|
||||
connect(this, &QObject::destroyed, pictureLoaderThread, &QThread::quit);
|
||||
connect(pictureLoaderThread, &QThread::finished, pictureLoaderThread, &QObject::deleteLater);
|
||||
|
||||
pictureLoaderThread->start(QThread::LowPriority);
|
||||
startNextPicDownload();
|
||||
}
|
||||
|
||||
void PictureLoaderWorkerWork::startNextPicDownload()
|
||||
|
|
|
|||
|
|
@ -33,7 +33,6 @@ public slots:
|
|||
void handleNetworkReply(QNetworkReply *reply);
|
||||
|
||||
private:
|
||||
QThread *pictureLoaderThread;
|
||||
bool picDownload;
|
||||
|
||||
void startNextPicDownload();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue