Skip to content

Commit

Permalink
Merge pull request #35 from sbesson/omerorequest_joinsession_resource…
Browse files Browse the repository at this point in the history
…_leak

OmeroRequest: close resources on client.joinSession() failure
  • Loading branch information
sbesson authored Feb 13, 2025
2 parents abdd5d3 + 32dc06e commit 643c0e3
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,11 @@ public OmeroRequest(String host, int port, String omeroSessionKey)
try {
client.joinSession(omeroSessionKey).detachOnDestroy();
log.debug("Successfully joined session: {}", omeroSessionKey);
} catch (Exception e) {
span.error(e);
log.debug("Failed to join session: {}", omeroSessionKey);
client.closeSession();
throw e;
} finally {
span.finish();
}
Expand Down

0 comments on commit 643c0e3

Please sign in to comment.