Fix: Leak of SessionManager by removing both removeSession method

This commit is contained in:
Lars Simon Winzer
2026-03-20 17:32:16 +01:00
parent 94fcd88223
commit e2e01addaa
@@ -85,38 +85,6 @@ public class SessionManager {
disconnect(event.sessionId()); disconnect(event.sessionId());
} }
/**
* Removes a session by its ID.
*
* @param id the ID of the session to remove
* @return the removed session, or null if not found
*/
public Session removeSession(SessionId id) {
SessionHandle handle = sessions.remove(id);
if (handle == null) {
return null;
}
return handle.session();
}
/**
* Removes the specified session.
*
* @param session the session to remove
* @return the removed session, or null if not found
*/
public Session removeSession(Session session) {
SessionHandle handle = sessions.remove(session.getId());
if (handle == null) {
return null;
}
return handle.session();
}
/** /**
* Retrieves a session by its ID. * Retrieves a session by its ID.
* *