|
From: Peng Yu <pen...@gm...> - 2011-09-07 06:44:36
|
On Wed, Sep 7, 2011 at 1:31 AM, Jeffrey Walton <nol...@gm...> wrote: > Hi Peng, > > On Wed, Sep 7, 2011 at 2:17 AM, Peng Yu <pen...@gm...> wrote: >> Hi, >> >> valgrind reports that there is possible lost. But it doesn't seem >> there should be any lost. Why valgrind reports it as possible lost? Is >> there a way to remove such 'possible lost' from the valgrind report? > I've found I'll get the same reports when using global objects. > > If you are using global objects, put them in an accessor function. In > an accessor, the dtors will run, and you won't violate C++'s rule on > non-local statics (and cross module dependencies). I don't exactly following your instructions. Would you please show me an concrete example on how to change my simple test code? Thanks! -- Regards, Peng |