diff --git a/wpilibc/src/main/native/cpp/event/BooleanEvent.cpp b/wpilibc/src/main/native/cpp/event/BooleanEvent.cpp index f5366e784ac..262c7ade08d 100644 --- a/wpilibc/src/main/native/cpp/event/BooleanEvent.cpp +++ b/wpilibc/src/main/native/cpp/event/BooleanEvent.cpp @@ -11,8 +11,7 @@ BooleanEvent::BooleanEvent(EventLoop* loop, std::function condition) m_condition(std::make_shared>(condition)) { m_state = std::make_shared((*m_condition)()); m_loop->Bind( - // NOLINTNEXTLINE(clang-analyzer-cplusplus.NewDeleteLeaks) - [condition = *m_condition, state = m_state] { *state = condition(); }); + [condition = m_condition, state = m_state] { *state = (*condition)(); }); } BooleanEvent::operator std::function() {