mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-22 01:11:42 +00:00
[ntcore] Various fixes and cleanups (#4544)
* NetworkTableInstance: set handle to 0 after destroy * Fix multiple notifications of local values * Detect mismatch between handles * Server: fix setting min period when no topics * Limit maximum number of subscribers/publishers/listeners This helps find resource leaks and prevents them from causing excessive slowdowns/crashes. The limit on each is currently set to 512. * Don't use std::swap in move operation
This commit is contained in:
@@ -68,6 +68,7 @@ public final class NetworkTableInstance implements AutoCloseable {
|
||||
if (m_owned && m_handle != 0) {
|
||||
m_listeners.close();
|
||||
NetworkTablesJNI.destroyInstance(m_handle);
|
||||
m_handle = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -986,5 +987,5 @@ public final class NetworkTableInstance implements AutoCloseable {
|
||||
}
|
||||
|
||||
private boolean m_owned;
|
||||
private final int m_handle;
|
||||
private int m_handle;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user