About consumption of GDI

julien2412 serval2412 at yahoo.fr
Mon May 18 09:23:15 UTC 2020


Hello,

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.
Trying to use Windbg !htrace -enable, then diff 

It seems LO leaks in VistaFilePickerImpl::impl_sta_ShowDialogModal
Indeed, after:
1037          if (iSave.is())
1038              hResult = iSave->Show( m_hParentWindow ); // parent window
needed

See
https://opengrok.libreoffice.org/xref/core/fpicker/source/win32/VistaFilePickerImpl.cxx?r=ffa636ba#1037
then leave the function, the GDI number doesn't decrease.

"iSave" is declared some lines above, like this:
TFileSaveDialog iSave = m_iDialogSave;

"TFileSaveDialog " is declared like this:
typedef ComPtr< IFileSaveDialog     , IID_IFileSaveDialog  ,
CLSID_FileSaveDialog > TFileSaveDialog;

ComPtr is a specific class which should release handle when the instance is
destroyed (see
https://opengrok.libreoffice.org/xref/core/fpicker/source/win32/comptr.hxx?r=591db0f9#30).

I wonder if this mechanism really works as expected.

I mean, shouldn't we try to release manually in impl_sta_ShowDialogModal ?

I'm quite a beginner with Windbg + GDI stuff so my analysis may be very
incomplete or even wrong.

Julien




--
Sent from: http://document-foundation-mail-archive.969070.n3.nabble.com/Dev-f1639786.html


More information about the LibreOffice mailing list