Commit 06124b7c authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gato

Remove MUCUser with no MUCRoles even if kick idle user is disabled. This fixes...

Remove MUCUser with no MUCRoles even if kick idle user is disabled. This fixes small memory leak. JM-1251

git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/trunk@9799 b35dd754-fafc-0310-a699-88a17e54d16e
parent d10b1b0d
...@@ -327,20 +327,20 @@ public class MultiUserChatServerImpl extends BasicModule implements MultiUserCha ...@@ -327,20 +327,20 @@ public class MultiUserChatServerImpl extends BasicModule implements MultiUserCha
} }
private void checkForTimedOutUsers() { private void checkForTimedOutUsers() {
// Do nothing if this feature is disabled (i.e USER_IDLE equals -1)
if (user_idle == -1) {
return;
}
final long deadline = System.currentTimeMillis() - user_idle; final long deadline = System.currentTimeMillis() - user_idle;
for (LocalMUCUser user : users.values()) { for (LocalMUCUser user : users.values()) {
try { try {
if (user.getLastPacketTime() < deadline) {
// If user is not present in any room then remove the user from // If user is not present in any room then remove the user from
// the list of users // the list of users
if (!user.isJoined()) { if (!user.isJoined()) {
removeUser(user.getAddress()); removeUser(user.getAddress());
continue; continue;
} }
// Do nothing if this feature is disabled (i.e USER_IDLE equals -1)
if (user_idle == -1) {
return;
}
if (user.getLastPacketTime() < deadline) {
// Kick the user from all the rooms that he/she had previuosly joined // Kick the user from all the rooms that he/she had previuosly joined
MUCRoom room; MUCRoom room;
Presence kickedPresence; Presence kickedPresence;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment