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

Deprecate and avoid unload event handler #9984

Merged
merged 6 commits into from
Oct 9, 2024

Conversation

niloc132
Copy link
Member

@niloc132 niloc132 commented Jul 20, 2024

Event handling for unload and beforeunload now is split, so that only explicit calls to WindowImpl.initWindowCloseHandler(), Window.addCloseHandler(), or Window.addWindowCloseListener() can cause the unload event handler to be attached - all of which are now deprecated. The beforeunload event wiring is now the only event handler set up when Window.addWindowClosingHandler etc are called.

RootPanel methods formerly intended to prevent memory leaks during the unload event are deprecated, since modern browsers do not leak these handlers, and may prevent correct behavior of apps using bfcache.

Documentation changed on using various static wrap(Element) methods to reflect how to detach, if desired, when the page is closed or no longer in use.

Fixes #9908

@niloc132 niloc132 added this to the 2.12 milestone Jul 20, 2024
Also adds suggestions on how they can be returned to semi-reliability.
@niloc132 niloc132 requested a review from jnehlmeier August 16, 2024 01:16
@niloc132 niloc132 requested a review from jnehlmeier August 28, 2024 18:45
@niloc132 niloc132 requested a review from jnehlmeier September 25, 2024 17:24
@niloc132 niloc132 merged commit 5ecb770 into gwtproject:main Oct 9, 2024
4 checks passed
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.

Remove general usage of Window unload event
2 participants