Skip to content

Commit 478ec80

Browse files
authored
Stop async thread in the destructor (#2941) (#2942)
1 parent e105f44 commit 478ec80

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

hardware_interface/src/hardware_component_interface.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,14 @@ HardwareComponentInterface::HardwareComponentInterface()
5050
{
5151
}
5252

53-
HardwareComponentInterface::~HardwareComponentInterface() = default;
53+
HardwareComponentInterface::~HardwareComponentInterface()
54+
{
55+
if (async_handler_)
56+
{
57+
async_handler_->stop_thread();
58+
}
59+
async_handler_.reset();
60+
}
5461

5562
CallbackReturn HardwareComponentInterface::init(
5663
const hardware_interface::HardwareComponentParams & params)

0 commit comments

Comments
 (0)