diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/ADIS16448_IMU.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/ADIS16448_IMU.java index d53f4ccc7d..2eddf64ee6 100644 --- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/ADIS16448_IMU.java +++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/ADIS16448_IMU.java @@ -656,6 +656,10 @@ public class ADIS16448_IMU implements AutoCloseable, Sendable { m_spi = null; } } + if (m_simDevice != null) { + m_simDevice.close(); + m_simDevice = null; + } System.out.println("Finished cleaning up after the IMU driver."); } diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/ADIS16470_IMU.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/ADIS16470_IMU.java index 8ca783098d..2fad3f34da 100644 --- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/ADIS16470_IMU.java +++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/ADIS16470_IMU.java @@ -681,6 +681,10 @@ public class ADIS16470_IMU implements AutoCloseable, Sendable { m_spi = null; } } + if (m_simDevice != null) { + m_simDevice.close(); + m_simDevice = null; + } System.out.println("Finished cleaning up after the IMU driver."); }