About consumption of GDI

Julien Nabet serval2412 at yahoo.fr
Wed May 20 13:13:52 UTC 2020

On 20/05/2020 14:43, Mike Kaganski wrote:
> On 18.05.2020 12:23, julien2412 wrote:
>> I made this test:
>> - launch Writer
>> - type 3 words and use a different font for each of them
>> - export in pdf
>> Using GDIView, it seems that each time I export in PDF, the number of GDI
>> increases.
> I seem to confirm increasing GDI handle count; in fact, I didn't need to
> type or change fonts; it was reproducible for me using a clean new
> document. Also it was not specific for PDF export: the same was
> happening when I simply used File->Save As. The increase (nAfter -
> nBefore; after waiting a few seconds for the count settles after the
> spike) was 2 or 3 each time.
> On the other hand, it didn't happen when I use File->Open dialog. I
> assume it might be something about our custom controls that we inject
> into the Save As dialog - do we free their resources correctly?
> I didn't debug it, though.

I added some traces in ctr and dtr of ComPtr and noticed that each time 
I call export in PDF directly, I got 1 call less of dtr compared to nb 
of calls to ctr.

Also, I got 48 call just after having clicked export directly, I mean 
without confirming the location.

I also noticed that i click "Cancel" instead of choosing a location, I 
got this warn:

warn:sfx.doc:16148:24436:sfx2/source/doc/objserv.cxx:844: Fatal IO error 
during save com.sun.star.task.ErrorCodeIOException message: 
ModelData_Impl::OutputFileDialog: ERRCODE_IO_ABORT: 283

and in the end, 47 calls to dtr (so again 1 call less than for ctr).

More information about the LibreOffice mailing list