class_loader icon indicating copy to clipboard operation
class_loader copied to clipboard

Is load_ref_count_ no need to count number?

Open daohu527 opened this issue 5 years ago • 0 comments

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

daohu527 avatar Oct 24 '20 14:10 daohu527