From 451f67c63de92f5b6e9ec246a02fce1ad0bc97cb Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sun, 27 Sep 2020 09:28:52 -0700 Subject: [PATCH] [hal] SimDevice class: remove HAL_SimDeviceHandle constructor (#2744) This isn't appropriate for a RAII class. In particular, it can cause foot-shooting in simulation mode if the result of HALSIM_GetSimDeviceHandle is passed instead of HAL_CreateSimDevice. --- hal/src/main/native/include/hal/SimDevice.h | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/hal/src/main/native/include/hal/SimDevice.h b/hal/src/main/native/include/hal/SimDevice.h index b05021e5ee..ff4c12e1b3 100644 --- a/hal/src/main/native/include/hal/SimDevice.h +++ b/hal/src/main/native/include/hal/SimDevice.h @@ -1,5 +1,5 @@ /*----------------------------------------------------------------------------*/ -/* Copyright (c) 2019 FIRST. All Rights Reserved. */ +/* Copyright (c) 2019-2020 FIRST. All Rights Reserved. */ /* Open Source Software - may be modified and shared by FRC teams. The code */ /* must be accompanied by the FIRST BSD license file in the root directory of */ /* the project. */ @@ -473,14 +473,6 @@ class SimDevice { */ SimDevice(const char* name, int index, int channel); - /** - * Wraps a simulated device handle as returned by HAL_CreateSimDevice(). - * - * @param handle simulated device handle - */ - /*implicit*/ SimDevice(HAL_SimDeviceHandle val) // NOLINT(runtime/explicit) - : m_handle(val) {} - ~SimDevice() { if (m_handle != HAL_kInvalidHandle) HAL_FreeSimDevice(m_handle); }