Resource leak in PDFengine
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.
(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.
This discussion has been closed.
Comments
Thank you for pointing this out. There is now a patch available that
makes this change.
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Hi, where can I download this patch?
--
Bye,
Andrea Nini
we'll send it to you as soon as possible. Note that this patch is only
available for RB 15.04.
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com