[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Static code analysis (cppcheck)

From: Julian Foad <julian.foad_at_wandisco.com>
Date: Thu, 30 Jun 2011 11:02:23 +0100

Philip Martin wrote:
> Julian Foad <julian.foad_at_wandisco.com> writes:
>
> >> To remove the warning I suppose we could drop the app variable, i.e.
> >>
> >> new QCoreApplication(...)
> >>
> >> instead of
> >>
> >> app = new QCoreApplication(...)
> >>
> >> but that might prompt other warnings.
> >
> > The existing code creates the object and (though it never uses its
> > address) never destroys it. With your change, the object would be
> > created and then immediately destroyed. That doesn't seem likely to be
> > what's needed, though I'm not sure exactly what is needed here.
>
> No, it would not be immediately destroyed. Code outside Subversion may
> destroy it via the singleton interface, but in most cases it will exist
> until the application terminates.

Oh, right, I see. Yes. I had to go and refresh my distant memory of C
++ programming before writing that, and I still got it wrong. :-(

- Julian
Received on 2011-06-30 12:03:12 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.