Project

General

Profile

Bug #3979 » 0001-Work-around-libharu-GState-memory-leak.patch

Bruce Toll, 04/14/2015 01:32 AM

View differences:

src/Wt/WPdfImage.C
{
beingDeleted();
if (myPdf_)
if (myPdf_) {
// clear graphics state stack to avoid leaking memory in libharu
HPDF_Page page = HPDF_GetCurrentPage(pdf_);
if (page)
while (HPDF_Page_GetGStateDepth(page) > 1)
HPDF_Page_GRestore(page);
HPDF_Free(pdf_);
}
delete trueTypeFonts_;
}
(1-1/2)