diff --git a/libuavcan_drivers/stm32/driver/include/uavcan_stm32/thread.hpp b/libuavcan_drivers/stm32/driver/include/uavcan_stm32/thread.hpp index 38ab49b74b..58c9fae21d 100644 --- a/libuavcan_drivers/stm32/driver/include/uavcan_stm32/thread.hpp +++ b/libuavcan_drivers/stm32/driver/include/uavcan_stm32/thread.hpp @@ -45,12 +45,13 @@ public: #elif UAVCAN_STM32_NUTTX -class Event +class Event : uavcan::Noncopyable { sem_t sem_; public: Event(); + ~Event(); bool wait(uavcan::MonotonicDuration duration); diff --git a/libuavcan_drivers/stm32/driver/src/uc_stm32_thread.cpp b/libuavcan_drivers/stm32/driver/src/uc_stm32_thread.cpp index bc4c2aa6c2..5d7a3382ff 100644 --- a/libuavcan_drivers/stm32/driver/src/uc_stm32_thread.cpp +++ b/libuavcan_drivers/stm32/driver/src/uc_stm32_thread.cpp @@ -62,6 +62,11 @@ Event::Event() (void)sem_init(&sem_, 0, 0); } +Event::~Event() +{ + (void)sem_destroy(&sem_); +} + bool Event::wait(uavcan::MonotonicDuration duration) { if (duration.isNegative())