[ros-users] Draft REP: Automatic unloading of libraries for pluginlib

Dave Hershberger hersh at willowgarage.com
Thu Feb 9 20:14:51 UTC 2012


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.

pluginlib::ClassLoader could have two interfaces, one which gives a
shared_ptr and manages the reference count for the library itself, and
another which gives a raw pointer and increments the ref count and also has
a decrement-ref-count function.

Dave

On Mon, Feb 6, 2012 at 4:44 PM, Dirk Thomas <dthomas at willowgarage.com>wrote:

> Hello all,
>
> attached is a draft specifying a minor enhancement to pluginlib which
> revises the load/create/unload life cycle of libraries.
>
> It enables automatic bookkeeping of created instance and automatically
> triggers unloading the library when the last instance goes out of scope.
> The proposal deprecates one existing method which can lead to difficult
> usage pattern (ranging from never unloading a library to unloading a
> library while it is still in use).
>
> The HTML version will be available soon:
> http://ros.org/reps/rep-0121.**html <http://ros.org/reps/rep-0121.html>
>
> Please send comments, questions or feedback.
> Due to the small scope I am also asking for your vote (according to the
> guidelines stated at http://www.ros.org/reps/rep-**0010.html<http://www.ros.org/reps/rep-0010.html>
> ).
>
> Best regards,
> Dirk
>
> _______________________________________________
> ros-users mailing list
> ros-users at code.ros.org
> https://code.ros.org/mailman/listinfo/ros-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ros.org/pipermail/ros-users/attachments/20120209/4aac294f/attachment-0004.html>


More information about the ros-users mailing list