shared pointer problem - can't destruct

I've gotten myself into a situation. I've got a class A that created class Bs class B needs to register callbacks to the class A that created it. So I made member variables in class B that are boost::function type class A binds the method to be called and hands that to class B on construction So, not class A always has a reference count and cannot be destoryed. I tried passing a weak_ptr to boost::bind instead and it won't compile. what to do?

I've got a class A that created class Bs class B needs to register callbacks to the class A that created it. So I made member variables in class B that are boost::function type class A binds the method to be called and hands that to class B on construction
So, not class A always has a reference count and cannot be destoryed.
I tried passing a weak_ptr to boost::bind instead and it won't compile.
You can either change your design, so that in one of the directions you pass raw ptr and a weak_ptr for tracking, or take a look at this message: http://permalink.gmane.org/gmane.comp.lib.boost.user/70276
participants (2)
-
Christopher Pisz
-
Igor R