mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-21 14:23:54 -07:00
[PictureLoader] Dumb hack to fix segfault (#6010)
This commit is contained in:
parent
6b44b9ae1e
commit
76fdbfaa2f
1 changed files with 4 additions and 1 deletions
|
|
@ -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()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue