code: public void disconnect() {
  		connection.getRoster().removeRosterListener(leagueRosterListener);
  		try {
  			connection.disconnect();
  		} catch (final NotConnectedException e) {
  			e.printStackTrace();
  		}
  		stop = true;
  	}
docs: Disconnects from chatserver and releases all resources.