[PictureLoader] Dumb hack to fix segfault

This commit is contained in:
RickyRister 2025-06-26 09:36:20 -07:00
parent 8615c4c3b0
commit 74fd585c40

View file

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