This repository has been archived by the owner on May 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[Android] Keep track of created ConditionalFocusLayouts so they can all be disposed of #2857
Merged
Conversation
This file contains 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
samhouts
approved these changes
May 29, 2018
@@ -3,6 +3,7 @@ | |||
using System.Collections.Specialized; | |||
using System.Threading.Tasks; | |||
using Xamarin.Forms.Internals; | |||
using System.Linq; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
hartez
previously requested changes
Jun 5, 2018
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, let's just loop once on Dispose for simplicity.
|
||
renderedView?.Dispose(); | ||
renderedView = null; | ||
// Having just this loop would probably be sufficient but |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like this covers everything the previous loop does (and more); let's just loop once. It'll make the code easier to understand.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hartez fixed
* keep track of created ConditionalFocusLayout's so they can all be disposed of
build --uitests |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Description of Change
Currently DisposeCells only iterates using GetChildAt which will only return visible cells. When you would scroll a listview this would cause a cell to not be visible and would thus return NULL for GetChildAt but the ConditionalFocusLayout would still exist in memory. This fix keeps track of created Layouts in an internal list to ensure that all resources get disposed of
I can't say for sure if this is the only cause of #2829 but it definitely fixes a case where Dispose wasn't being called for a given cell.
Bugs Fixed
fixes #2829
PR Checklist