Hi,
On Thu, Feb 9, 2012 at 12:55 PM, Dirk Thomas <dthomas@willowgarage.com> wrote:That sounds like a very reasonable use case.While I like boost::shared_ptr, it is not always possible to use it nicely.
In rviz I have plugin classes which are subclasses of QWidget (from Qt GUI library). These objects are automatically deleted by Qt when their parent widgets are deleted. I can be notified of their
deletion by Qt, and call an "unload" or "decrement-reference-count" function, but it is not easy to use these QWidget pointers inside boost::shared_ptr without getting double-deletion crashes.
Automatically deleting and unloading is a nice feature but might not always be desired.
Having the option to get a raw pointer (as before) and take care of garbaging stuff manually would be great.
I don't like this, but don't see a clearly better solution.