mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-14 22:42:14 -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
|
// Hook up signals to settings
|
||||||
connect(&SettingsCache::instance(), SIGNAL(picDownloadChanged()), this, SLOT(picDownloadChanged()));
|
connect(&SettingsCache::instance(), SIGNAL(picDownloadChanged()), this, SLOT(picDownloadChanged()));
|
||||||
|
|
||||||
pictureLoaderThread = new QThread;
|
startNextPicDownload();
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PictureLoaderWorkerWork::startNextPicDownload()
|
void PictureLoaderWorkerWork::startNextPicDownload()
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,6 @@ public slots:
|
||||||
void handleNetworkReply(QNetworkReply *reply);
|
void handleNetworkReply(QNetworkReply *reply);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QThread *pictureLoaderThread;
|
|
||||||
bool picDownload;
|
bool picDownload;
|
||||||
|
|
||||||
void startNextPicDownload();
|
void startNextPicDownload();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue