Skip to content

Commit

Permalink
Merge pull request #8 from chrissmith-mcafee/master
Browse files Browse the repository at this point in the history
Unregister services when client is closed
  • Loading branch information
chrissmith-mcafee authored Sep 23, 2019
2 parents a5e6b7a + 52b43bc commit ced5381
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/com/opendxl/client/DxlClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -325,14 +325,14 @@ public final void close() throws Exception {

synchronized (this) {
if (this.init) {
doDisconnectQuietly();

try {
this.serviceManager.close();
} catch (final Exception ex) {
logger.error("Error during close of service manager", ex);
}

doDisconnectQuietly();
doClose();
this.init = false;
}
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/opendxl/client/ServiceManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,8 @@ private void commonOnRequest(final ServiceRegistrationHandler service, final Req
*/
@Override
public void close() {
// Unregister services
onDisconnect();
}

/**
Expand Down

0 comments on commit ced5381

Please sign in to comment.