mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-10 00:04:48 -07:00
[PictureLoader] Fix double-queueing bug (#6014)
This commit is contained in:
parent
c57b84cb17
commit
ed82106359
2 changed files with 2 additions and 6 deletions
|
|
@ -67,8 +67,7 @@ void PictureLoaderWorker::queueRequest(const QUrl &url, PictureLoaderWorkerWork
|
|||
QUrl cachedRedirect = getCachedRedirect(url);
|
||||
if (!cachedRedirect.isEmpty()) {
|
||||
queueRequest(cachedRedirect, worker);
|
||||
}
|
||||
if (cache->metaData(url).isValid()) {
|
||||
} else if (cache->metaData(url).isValid()) {
|
||||
makeRequest(url, worker);
|
||||
} else {
|
||||
requestLoadQueue.append(qMakePair(url, worker));
|
||||
|
|
|
|||
|
|
@ -194,10 +194,7 @@ QImage PictureLoaderWorkerWork::tryLoadImageFromReply(QNetworkReply *reply)
|
|||
void PictureLoaderWorkerWork::concludeImageLoad(const QImage &image)
|
||||
{
|
||||
emit imageLoaded(cardToDownload.getCard(), image);
|
||||
|
||||
// Delayed delete is a dumb hack to prevent segfaults due to calling methods on a deleted Work
|
||||
// TODO: find a more proper way to structure this whole thing
|
||||
QTimer::singleShot(2000, this, &QObject::deleteLater);
|
||||
deleteLater();
|
||||
}
|
||||
|
||||
void PictureLoaderWorkerWork::picDownloadChanged()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue