mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
Call reachabilityFence inside finally blocks (#7001)
This commit is contained in:
@@ -74,13 +74,16 @@ public class AnalogTrigger implements Sendable, AutoCloseable {
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
SendableRegistry.remove(this);
|
||||
AnalogJNI.cleanAnalogTrigger(m_port);
|
||||
m_port = 0;
|
||||
if (m_ownsAnalog && m_analogInput != null) {
|
||||
m_analogInput.close();
|
||||
try {
|
||||
SendableRegistry.remove(this);
|
||||
AnalogJNI.cleanAnalogTrigger(m_port);
|
||||
m_port = 0;
|
||||
if (m_ownsAnalog && m_analogInput != null) {
|
||||
m_analogInput.close();
|
||||
}
|
||||
} finally {
|
||||
Reference.reachabilityFence(m_dutyCycle);
|
||||
}
|
||||
Reference.reachabilityFence(m_dutyCycle);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user