pXDevice in filter/source/pdf/pdfexport.cxx

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

pXDevice in filter/source/pdf/pdfexport.cxx

tora - Takamichi Akiyama
Hi,

3.1.1/OOO310_m19/filter/source/pdf/pdfexport.cxx has a function

sal_Bool PDFExport::Export(...)
{
     VCLXDevice* pXDevice = new VCLXDevice;

There seems no "delete pXDevice;" there. Is that intended?

Thanks in advance,
Tora

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: pXDevice in filter/source/pdf/pdfexport.cxx

Kai Ahrens
Hi Tora,

tora - Takamichi Akiyama schrieb:
> Hi,
>
> 3.1.1/OOO310_m19/filter/source/pdf/pdfexport.cxx has a function
>
> sal_Bool PDFExport::Export(...)
> {
>     VCLXDevice* pXDevice = new VCLXDevice;
>
> There seems no "delete pXDevice;" there. Is that intended?

this pointer is assigned to a Reference object a few lines later,
which will take care of proper refcounting and destruction:

aRenderOptions[ 0 ].Value <<= Reference< awt::XDevice >( pXDevice );

Although I must admit, that this is done only in case of pOut != NULL.
In case of pOut == NULL, there doesn't seem to be correct destruction
afterwards.

Putting Philipp on Cc to review this.

With best regards
Kai


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]