[PictureLoader] Dumb hack to fix segfault (#6010)

This commit is contained in:
RickyRister 2025-06-29 19:21:12 -07:00 committed by GitHub
parent 6b44b9ae1e
commit 76fdbfaa2f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -194,7 +194,10 @@ QImage PictureLoaderWorkerWork::tryLoadImageFromReply(QNetworkReply *reply)
void PictureLoaderWorkerWork::concludeImageLoad(const QImage &image)
{
emit imageLoaded(cardToDownload.getCard(), image);
this->deleteLater();
// 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);
}
void PictureLoaderWorkerWork::picDownloadChanged()