ParagraphText: immediately remove listeners from selections and carets on disposal#791
Merged
Jugen merged 5 commits intoFXMisc:masterfrom Dec 16, 2018
Merged
Conversation
…two WeakReference.get() invocations
…ret on dispose instead of waiting for GC (this improves PR FXMisc#779, issue FXMisc#627) without this change, disposed ParagraphText objects still listen to selection and caret and do some useless stuff
…ion and caret listeners, remove listener classes again and move listener code to constructor (saves 100 lines of code)
…ay both return true when replacing an item. So check both and handle wasRemoved() before wasAdded(). (don't know whether this may occur in RichTextFX, but want to be on the safe side)
Contributor
Author
|
Forgot to mention that I've debugged the change and also used VisualVM to check whether the change still fixes the old memory leak (that was fixed in PR #779). @JonathanMarchand would you be so kind and also test this PR? Thx |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR immediately removes listeners (in class
ParagraphText) fromSelectionPathandCareton disposal instead of waiting for GC (this improves PR #779, issue #627). Without this change, disposed ParagraphText objects may still listen to selection and caret and do some useless stuff.Since the weak listeners added in PR #779 are no longer necessary, I've removed the listener classes again and moved selection and caret listeners code back to constructor (saves 100 lines of code).