ros / class_loader

ROS-independent library for dynamic class (i.e. plugin) introspection and loading from runtime libraries
http://www.ros.org/wiki/class_loader
34 stars 95 forks source link

Is load_ref_count_ no need to count number? #171

Open daohu527 opened 3 years ago

daohu527 commented 3 years ago

There is a lock load_ref_lock and class_loader::impl::loadLibrary(getLibraryPath(), this) will not load .so library twice. Why not just use a bool is_loaded to load and unload the .so library.

I didn't see the benefits of counting times of the loadLibrary. The unloadLibrary will do nothing when load_ref_count_ > 0 too.

https://github.com/ros/class_loader/blob/a183b762a81c91647c3828823b33d64fed1b6e45/src/class_loader.cpp#L100-L102