[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:
Peter Johnson
2022-11-04 20:01:21 -07:00
committed by GitHub
parent 837415abfd
commit 4ba16db645
9 changed files with 215 additions and 42 deletions

View File

@@ -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;
}