Thanks guys.
I was misusing a shared_ptr. I had two shared_ptr's pointing to the
same object (that didn't know about each other).
I apologize if this was more appropriate for gcc-help. Some of the
details of how dtors get called is still magic to me and I thought it
may be gcc specific.
On Feb 15, 2006, at 2:40 PM, Mike Stump wrote:
On Feb 15, 2006, at 7:27 AM, Perry Smith wrote:
I am assuming I am doing something wrong but I am hoping someone can
give me a clue as to where to look.
I'd fire up a debugger and type up a couple of times from a
breakpoint in the dtor. If you want to randomly try things, if you
inserted code to call the dtors, remove it, and then see if
everything then works.
Or, you should be able to statically analyze something like:
int bar = 0;
class S {
~S() { ++bar; }
} a;
if you'd rather do that.