Fixed memory leak

This commit is contained in:
LAX1DUDE 2022-04-02 10:56:01 -07:00
parent cfa513a4f8
commit 1fd47f074e
3 changed files with 14 additions and 2 deletions

Binary file not shown.

View File

@ -1,3 +1,5 @@
### THIS IS A BUNGEE PLUGIN! Install in 'bungee_command/plugins' not 'bukkit_command/plugins'
# EaglerMOTD # EaglerMOTD
### This plugin can add animated MOTDs to your Eaglercraft server ### This plugin can add animated MOTDs to your Eaglercraft server

View File

@ -117,7 +117,12 @@ public class MOTDConnection {
currentFrame = currentMessage.random ? rand.nextInt(currentMessage.frames.size()) : 0; currentFrame = currentMessage.random ? rand.nextInt(currentMessage.frames.size()) : 0;
applyFrame(currentMessage.frames.get(currentFrame)); applyFrame(currentMessage.frames.get(currentFrame));
motd.sendToUser(); motd.sendToUser();
if(currentMessage.next == null && currentMessage.interval <= 0) {
motd.close();
return false;
}else {
return true; return true;
}
}else { }else {
this.motd.close(); this.motd.close();
return false; return false;
@ -143,9 +148,14 @@ public class MOTDConnection {
motd.sendToUser(); motd.sendToUser();
} }
} }
if(currentMessage.next == null && currentMessage.interval <= 0) {
motd.close();
return false;
}else {
return true; return true;
} }
} }
}
private boolean changeMessageTo(String group, String s) { private boolean changeMessageTo(String group, String s) {
List<MessagePoolEntry> lst = EaglerMOTD.messages.get(group); List<MessagePoolEntry> lst = EaglerMOTD.messages.get(group);