From 4fa8483040cc584734e2ad840b63a20376414454 Mon Sep 17 00:00:00 2001 From: Joseph Eng Date: Sat, 12 Aug 2023 11:31:59 -0700 Subject: [PATCH] Move deference from capture to body --- wpilibc/src/main/native/cpp/event/BooleanEvent.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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() {