this.serverSessionManager.releaseNodeState(this.nodeState, session);
this.nodeState = null;
this.session = null;
+ unregister();
// Clear all requests we know about
for (final Entry<S, PCEPRequest> e : this.requests.entrySet()) {
@Override
public void close() {
- if (this.registration != null) {
- this.registration.close();
- }
+ unregister();
if (this.session != null) {
this.session.close(TerminationReason.Unknown);
}
}
+ private synchronized void unregister() {
+ if (this.registration != null) {
+ this.registration.close();
+ this.registration = null;
+ }
+ }
+
protected final synchronized PCEPRequest removeRequest(final S id) {
final PCEPRequest ret = this.requests.remove(id);
if (ret != null) {