Boost logo

Boost Users :

Subject: Re: [Boost-users] [Q] scoped_ptr for forward declared classes
From: V S P (toreason_at_[hidden])
Date: 2009-03-31 14:04:48


thank you very much,
I do have quite a few static variables.
I will try this if does not work, I will create an example
of the problem and post it here.

I actually started using
_CrtMemState state;
_CrtMemCheckpoint(&state2);

//my heap allocation code goes here

_CrtMemDumpAllObjectsSince(&state);

and I am seeing much fewer, so I think it coincides with your suggestion
about static initializations.

Vlad

I was just looking for 'look here or try there' type of suggestion
which you provided.

thanks again,
Vlad

On Tue, 31 Mar 2009 20:33 +0300, "Peter Dimov" <pdimov_at_[hidden]>
wrote:
> V S P:
>
> > and still trying to debug why shared_ptr reports mem leaks with Visual
> > Studio.
>
> In general, for us to be able to help, you have to post a complete
> program
> that reports a leak. Your previous example was not just heavily
> abbreviated
> and used the wrong class names, it also didn't have any uses of
> shared_ptr
> at all (although it did have a thread_specific_ptr.)
>
> False leak reports are typically caused by static variables whose
> destructors haven't yet run when the leak report is generated. Try
> calling
> .reset() on all static shared_ptr variables before exit and see if the
> leaks
> disappear.
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users

-- 
  V S P
  toreason_at_[hidden]
-- 
http://www.fastmail.fm - Does exactly what it says on the tin

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net