Re: smart pointers, slicing, and double deletion

Nigel Atkinson <[email protected]>
Newsgroups gmane.comp.lang.lua.bind.user
Message-ID <1259189986.3058.18.camel@hurin>
> How so? Does the test case you attached show this if I replace
> intrusive_ptr with shared_ptr?

I think so.  What I was seeing, was that the ref count stayed at 1
regardless of how many vars pointed at the instance.  With out the
converter, the ref count went up and down as expected.  I'm pretty sure
to see that, you just need to swap intrusive for shared.  Otherwise I
can dig up an old copy for you.  The effect is subtle in this case as
the double delete only happens if a child widget is deleted before a
parent.  I thought it might be something weird with a thread ending, but
I never explored that. Also, strangely, setting the parent to nil, did
not seem to cause double delete.

If don't have any work this afternoon, I'll try and make a minimal test
case that demonstrates what I was seeing. 

Nigel


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.