Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,11 @@ public void deleteObject(ModeledAuthenticatedUser user, String identifier)

if (hasObjectPermissions(user, identifier, ObjectPermission.Type.DELETE)) {

// Close connection if not already closed
// Always close, even if the peer already vanished (isOpen() may be
// false). close() releases the active connection record and is
// idempotent.
GuacamoleTunnel tunnel = activeConnection.getTunnel();
if (tunnel != null && tunnel.isOpen())
if (tunnel != null)
tunnel.close();

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,14 @@ public ManagedInetGuacamoleSocket(String hostname, int port,

@Override
public void close() throws GuacamoleException {
super.close();
socketClosedTask.run();
// Run cleanup even if super.close() throws, or the active connection
// record could leak.
try {
super.close();
}
finally {
socketClosedTask.run();
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,14 @@ public ManagedSSLGuacamoleSocket(String hostname, int port,

@Override
public void close() throws GuacamoleException {
super.close();
socketClosedTask.run();
// Run cleanup even if super.close() throws, or the active connection
// record could leak.
try {
super.close();
}
finally {
socketClosedTask.run();
}
}

}