We may be racing with other callbacks, make sure we synchronize. Also
ensure we guard registrations properly.
Change-Id: If6b1e679b91bd2da21d82f0ac81f570c51284f10
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
}
@Override
- public void close() {
+ public synchronized void close() {
if (this.bgpPeerSingletonService != null) {
- this.stateProviderRegistration.close();
this.bgpPeerSingletonService.closeServiceInstance();
- this.stateProviderRegistration = null;
this.bgpPeerSingletonService = null;
}
+ if (this.stateProviderRegistration != null) {
+ this.stateProviderRegistration.close();
+ this.stateProviderRegistration = null;
+ }
}
@Override