diff --git a/cockatrice/src/client/ui/picture_loader/picture_loader_worker.cpp b/cockatrice/src/client/ui/picture_loader/picture_loader_worker.cpp index 6d7478765..a8b5dd6a0 100644 --- a/cockatrice/src/client/ui/picture_loader/picture_loader_worker.cpp +++ b/cockatrice/src/client/ui/picture_loader/picture_loader_worker.cpp @@ -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)); diff --git a/cockatrice/src/client/ui/picture_loader/picture_loader_worker_work.cpp b/cockatrice/src/client/ui/picture_loader/picture_loader_worker_work.cpp index b94772b24..533f4c116 100644 --- a/cockatrice/src/client/ui/picture_loader/picture_loader_worker_work.cpp +++ b/cockatrice/src/client/ui/picture_loader/picture_loader_worker_work.cpp @@ -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()