Skip to content

Listen for GUI close #81

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Listen for GUI close #81

wants to merge 1 commit into from

Conversation

KingsMMA
Copy link
Contributor

This serves both to allow plugins to more easily detect when their GUIs are closed, and also to ensure that click listeners are unregistered and slot actions are removed to prevent memory leaks.

Unless I'm mistaken, there's still a listener registered for each GUI opened, as well as a bunch of slot actions stored in memory. While these should now be cleared up when the player sends a close inventory packet, theoretically a malicious player could use a modded client to not send close packets and spam open a bunch of GUIs. This would register a bunch of listeners and store a bunch of click actions and GUIs in memory, potentially crashing the server.

That is purely theoretical though, I don't know if that would actually work.

This serves both to allow plugins to more easily detect when their GUIs
are closed, and also to ensure that click listeners are unregistered and
slot actions are removed to prevent memory leaks.

Unless I'm mistaken, there's still a listener registered for each GUI
opened, as well as a bunch of slot actions stored in memory.  While
these should now be cleared up when the player sends a close inventory
packet, theoretically a malicious player could use a modded client to
not send close packets and spam open a bunch of GUIs.  This would
register a bunch of listeners and store a bunch of click actions and
GUIs in memory, potentially crashing the server.

That is purely theoretical though, I don't know if that would actually work.
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.

1 participant