Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Resource leak in PDFengine

edited May 2014 in General
Hi,

(RbPRo 15.04, Delphi XE4)


There is a resource leak in the PDF-engine. Some of our customers
discovered this when producing invoices as pdf's in large batches. After
around 200 pdf's the application crashes with a "invalid handle" or "out of
resources" exception. Checking with SysInternals PE-Explorer revealed that
the number of used GDI-objects increases with around 50 for each pdf, so
after 200 pdf's the maximum of 10000 GDI-objects is reached.

procedure TppPDFUtils.FontStyleList in pdfUtils.pas is the problem. It does
a GetDC but the ReleaseDC is missing! So the solution is simple, just add
ReleaseDC(0, lDC) at the of the proc.

It depends on the report if this proc gets called, seems that it is only
done for multiline texts with a bold font.


Regards,

Max Paay
Quadrant Software bv.
The Netherlands.

Comments

  • edited May 2014
    Hi Max,

    Thank you for pointing this out. There is now a patch available that
    makes this change.

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited May 2014
    > Thank you for pointing this out. There is now a patch available that

    Hi, where can I download this patch?

    --
    Bye,
    Andrea Nini
  • edited May 2014
    Send an email to support@digital-metaphors.com requesting the patch and
    we'll send it to you as soon as possible. Note that this patch is only
    available for RB 15.04.

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.