Question about filter/source/msfilter/msdffimp.cxx

Caolán McNamara caolanm at redhat.com
Mon May 28 05:13:02 PDT 2012


On Mon, 2012-05-28 at 05:01 -0700, julien2412 wrote:
> Before I create a tracker for cppcheck, I'd like to know at what corrrespond
> these curly parenthesis.
> I found nothing about this kind of construct in C++ however I know it's ok
> since it compiles ok.

These add scope to the objects inside the {} e.g 

{
    FOO thing;
} //<-- thing's dtor is basically called here

so if you remove the scoping braces then the objects get destroyed later
on. If the initial developer stuck them in, then there's almost
certainly a very good reason the objects have to be destroyed at the
explicit end of scope. e.g. in your example xObjStg is the likely
special thing that must be destroyed right at the } and not continue to
live to the end of the prior enclosing if statement.

Worth going ahead and filing that cppcheck bug, and leave the .cxx
alone :-)

C.



More information about the LibreOffice mailing list