Add cleanup function to mac pdf image buffer

This commit is contained in:
Felix Kauselmann 2016-11-22 18:23:40 +01:00
parent 46d06f441a
commit 595ceecb62
3 changed files with 1 additions and 5 deletions

View File

@ -627,9 +627,6 @@ void ThumbnailCreator::create()
{
#if defined Q_OS_MAC || defined USE_PDFIUM
QImage p = pdfComic->getPage(_coverPage-1); //TODO check if the page is valid
#ifdef USE_PDFKIT
pdfComic->releaseLastPageData();
#endif
#else
QImage p = pdfComic->page(_coverPage-1)->renderToImage(72,72);
#endif //

View File

@ -861,7 +861,6 @@ void PDFComic::renderPage(int page)
QImage img = pdfComic->getPage(page);
if(!img.isNull())
{
pdfComic->releaseLastPageData();
#elif defined USE_PDFIUM
QImage img = pdfComic->getPage(page);
if(!img.isNull())

View File

@ -108,7 +108,7 @@ QImage MacOSXPDFComic::getPage(const int pageNum)
const uchar *bytes = (const uchar *)CFDataGetBytePtr(dataRef);
qtImage = QImage(bytes, pageRect.size.width, pageRect.size.height, QImage::Format_ARGB32);
qtImage = QImage(bytes, pageRect.size.width, pageRect.size.height, QImage::Format_ARGB32, &releaseLastPageData());
CGImageRelease(image);
//CFRelease(dataRef);