YACReader: Fix crash when exiting while processing a comic

When quitting YACReader while processing a comic, the comic thread needs
to be properly terminated to avoid segfaults and other possible problems.
This commit is contained in:
Felix Kauselmann
2022-11-12 23:09:27 +01:00
committed by Luis Ángel San Martín
parent 21b8b70657
commit 0414104067
3 changed files with 17 additions and 10 deletions

View File

@ -890,8 +890,10 @@ void PDFComic::renderPage(int page)
#endif
QByteArray ba;
QBuffer buf(&ba);
buf.open(QIODevice::WriteOnly);
img.save(&buf, "jpg", 96);
_pages[page] = ba;
buf.close();
emit imageLoaded(page);
emit imageLoaded(page, _pages[page]);
}