Skip to content

Commit 2e85812

Browse files
authored
Merge branch 'rolling' into add_sanitizer_ci
2 parents 3c9b9c9 + eb967b7 commit 2e85812

15 files changed

Lines changed: 110 additions & 153 deletions

.appveyor.yml

Lines changed: 0 additions & 55 deletions
This file was deleted.

.appveyor/remove_python27_from_path.bat

Lines changed: 0 additions & 22 deletions
This file was deleted.

.github/workflows/mirror-rolling-to-ros2.yaml

Lines changed: 0 additions & 13 deletions
This file was deleted.

CHANGELOG.rst

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,36 @@
22
Changelog for package class_loader
33
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
44

5+
2.9.0 (2025-04-25)
6+
------------------
7+
* Remove CODEOWNERS and mirror-rolling-to-main workflow (`#215 <https://github.com/ros/class_loader/issues/215>`_)
8+
* Contributors: Alejandro Hernández Cordero
9+
10+
2.8.0 (2024-04-26)
11+
------------------
12+
13+
2.7.0 (2023-12-26)
14+
------------------
15+
* Remove all uses of ament_target_dependencies. (`#210 <https://github.com/ros/class_loader/issues/210>`_)
16+
* Update to C++17 (`#209 <https://github.com/ros/class_loader/issues/209>`_)
17+
* Contributors: Chris Lalancette
18+
19+
2.6.0 (2023-04-28)
20+
------------------
21+
22+
2.5.0 (2023-02-13)
23+
------------------
24+
* make sanitizer happy (`#205 <https://github.com/ros/class_loader/issues/205>`_)
25+
* [rolling] Update maintainers - 2022-11-07 (`#206 <https://github.com/ros/class_loader/issues/206>`_)
26+
* Contributors: Audrow Nash, Chen Lihui
27+
28+
2.4.0 (2022-11-02)
29+
------------------
30+
* Remove appveyor configuration. (`#204 <https://github.com/ros/class_loader/issues/204>`_)
31+
* Just fix a typo in a comment. (`#203 <https://github.com/ros/class_loader/issues/203>`_)
32+
* make the meta-object alive in the lifecycle of the registered plugin (`#201 <https://github.com/ros/class_loader/issues/201>`_)
33+
* Contributors: Chen Lihui, Chris Lalancette
34+
535
2.3.1 (2022-09-13)
636
------------------
737
* Mirror rolling to ros2

CMakeLists.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@ cmake_minimum_required(VERSION 3.5)
22

33
project(class_loader)
44

5-
# Default to C++14
5+
# Default to C++17
66
if(NOT CMAKE_CXX_STANDARD)
7-
set(CMAKE_CXX_STANDARD 14)
7+
set(CMAKE_CXX_STANDARD 17)
8+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
89
endif()
910
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
1011
add_compile_options(-Wall -Wextra -Wpedantic)
@@ -30,19 +31,18 @@ if(ament_cmake_FOUND)
3031
ament_export_dependencies(rcpputils)
3132
endif()
3233

33-
set(${PROJECT_NAME}_SRCS
34+
add_library(${PROJECT_NAME} ${explicit_library_type}
3435
src/class_loader.cpp
3536
src/class_loader_core.cpp
3637
src/meta_object.cpp
3738
src/multi_library_class_loader.cpp
3839
)
39-
add_library(${PROJECT_NAME} ${explicit_library_type} ${${PROJECT_NAME}_SRCS})
4040
target_include_directories(${PROJECT_NAME} PUBLIC
4141
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
4242
"$<INSTALL_INTERFACE:include/${PROJECT_NAME}>")
4343

4444
if(ament_cmake_FOUND)
45-
target_link_libraries(${PROJECT_NAME}
45+
target_link_libraries(${PROJECT_NAME} PUBLIC
4646
console_bridge::console_bridge
4747
rcpputils::rcpputils)
4848
ament_export_targets(${PROJECT_NAME})

include/class_loader/class_loader.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ class ClassLoader
238238

239239
/**
240240
* @brief Attempts to unload a library loaded within scope of the ClassLoader. If the library is
241-
* not opened, this method has no effect. If the library is opened by other another ClassLoader,
241+
* not opened, this method has no effect. If the library is opened by another ClassLoader,
242242
* the library will NOT be unloaded internally -- however this ClassLoader will no longer be able
243243
* to instantiate class_loader bound to that library. If there are plugin objects that exist in
244244
* memory created by this classloader, a warning message will appear and the library will not be

include/class_loader/class_loader_core.hpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,23 @@ registerPlugin(const std::string & class_name, const std::string & base_class_na
282282
break;
283283
}
284284
}
285+
286+
BaseToFactoryMapMap & factory_map_map = getGlobalPluginBaseToFactoryMapMap();
287+
bool erase_flag = false;
288+
for (auto & factory_map_item : factory_map_map) {
289+
FactoryMap & factory_map = factory_map_item.second;
290+
for (auto iter = factory_map.begin(); iter != factory_map.end(); ++iter) {
291+
if (iter->second == p) {
292+
factory_map.erase(iter);
293+
erase_flag = true;
294+
break;
295+
}
296+
}
297+
if (erase_flag) {
298+
break;
299+
}
300+
}
301+
285302
getPluginBaseToFactoryMapMapMutex().unlock();
286303

287304
#ifndef _WIN32

package.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
<?xml version="1.0"?>
22
<package format="2">
33
<name>class_loader</name>
4-
<version>2.3.1</version>
4+
<version>2.9.0</version>
55
<description>
66
The class_loader package is a ROS-independent package for loading plugins during runtime and the foundation of the higher level ROS "pluginlib" library.
77
class_loader utilizes the host operating system's runtime loader to open runtime libraries (e.g. .so/.dll files), introspect the library for exported plugin classes, and allows users to instantiate objects of these exported classes without the explicit declaration (i.e. header file) for those classes.
88
</description>
99

1010
<maintainer email="geoff@openrobotics.org">Geoffrey Biggs</maintainer>
11-
<maintainer email="michael@openrobotics.org">Michael Carroll</maintainer>
1211

1312
<license>BSD</license>
1413

1514
<url type="website">http://ros.org/wiki/class_loader</url>
1615

1716
<author>Dirk Thomas</author>
17+
<author email="michael@openrobotics.org">Michael Carroll</author>
1818
<author email="michel@ekumenlabs.com">Michel Hidalgo</author>
1919
<author>Mirza Shah</author>
2020
<author email="stevenragnarok@osrfoundation.org">Steven! Ragnarök</author>

src/class_loader.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,10 @@ int ClassLoader::unloadLibrary()
117117

118118
int ClassLoader::unloadLibraryInternal(bool lock_plugin_ref_count)
119119
{
120-
std::lock_guard<std::recursive_mutex> load_ref_lock(load_ref_count_mutex_);
121120
if (lock_plugin_ref_count) {
122121
plugin_ref_count_mutex_.lock();
123122
}
123+
std::lock_guard<std::recursive_mutex> load_ref_lock(load_ref_count_mutex_);
124124

125125
try {
126126
if (plugin_ref_count_ > 0) {

src/class_loader_core.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -521,9 +521,12 @@ void unloadLibrary(const std::string & library_path, ClassLoader * loader)
521521
throw class_loader::LibraryUnloadException(
522522
"Could not unload library (rcpputils exception = " + std::string(e.what()) + ")");
523523
}
524+
} else {
525+
CONSOLE_BRIDGE_logDebug(
526+
"class_loader.impl: "
527+
"Attempt to unload library %s that class_loader is unaware of or is already unloaded",
528+
library_path.c_str());
524529
}
525-
throw class_loader::LibraryUnloadException(
526-
"Attempt to unload library that class_loader is unaware of.");
527530
}
528531
}
529532

0 commit comments

Comments
 (0)