Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ram leak #97

Closed
wants to merge 1 commit into from
Closed

Fix ram leak #97

wants to merge 1 commit into from

Conversation

CyriacF
Copy link

@CyriacF CyriacF commented May 17, 2023

Fix ram leak with the PostLogin task never removed

@CyriacF
Copy link
Author

CyriacF commented May 17, 2023

image

@breitwan
Copy link

breitwan commented May 23, 2023

I think in this case it is better to do it in one operation.

@Subscribe
public void onPostLogin(PostLoginEvent event) {
  UUID uuid = event.getPlayer().getUniqueId();
  final Runnable postLoginTask = plugin.getPostLoginTasks().remove(uuid);
  if (postLoginTask != null) {
    this.plugin.getServer().getScheduler()
        .buildTask(this.plugin, () -> postLoginTask.run())
        .delay(Settings.IMP.MAIN.PREMIUM_AND_FLOODGATE_MESSAGES_DELAY, TimeUnit.MILLISECONDS)
        .schedule();
  }
}

@hevav hevav closed this in beb4871 Jul 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants