Boost logo

Boost Users :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2005-05-14 15:32:10

Jean-François Brouillet wrote:

> As far as I understand what is going on, the reason why
> the runtime is reporting a "double free" is because two independently
> constructed shared_ptrs' do not share the same reference count,
> which intrusive_ptr would allow me to do, except that intrusive_ptr
> doesn't vary "polymorphically" with its body as shared_ptr does.

I'm not sure what you mean by that.

intrusive_ptr<> aside, you need to derive from enable_shared_from_this<> if
you want to create a shared_ptr<> to this as explained in:

but you can't do this in a constructor, because the outer shared_ptr<>
hasn't been created yet. Use a static create() function as explained here:

The other option is intrusive_ptr<>.

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at