Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

Fix the memory leak problem of ListViewRenderer _headerRenderer #11699

Merged

Conversation

lindexi
Copy link
Contributor

@lindexi lindexi commented Aug 8, 2020

Description of Change

When we changed the Element with empty HeaderElement, the ListViewRenderer will enter UpdateHeader method to update the _headerRenderer field. But the UpdateHeader method will only call the _headerRenderer.Dispose() and do not release the reference.

This means that the old "_headerRenderer" object will be referenced by "ListViewRenderer" resulting in a memory leak

Issues Resolved

API Changes

None

Platforms Affected

  • WPF

Behavioral/Visual Changes

None

Before/After Screenshots

Not applicable

Testing Procedure

PR Checklist

  • Targets the correct branch
  • Tests are passing (or failures are unrelated)

@rmarinho
Copy link
Member

/azp run

@xamarin xamarin deleted a comment from azure-pipelines bot Aug 12, 2020
@samhouts samhouts added the approved Has two approvals, no pending reviews, and no changes requested label Aug 12, 2020
@rmarinho rmarinho merged commit 6044d38 into xamarin:main Aug 13, 2020
@lindexi lindexi deleted the t/lindexi/ListViewRendererMemoryLeak branch August 13, 2020 10:22
pictos pushed a commit to pictos/Xamarin.Forms that referenced this pull request Sep 12, 2020
domagojmedo pushed a commit to domagojmedo/Xamarin.Forms that referenced this pull request Sep 12, 2020
pictos pushed a commit to pictos/Xamarin.Forms that referenced this pull request Sep 12, 2020
shyunMin pushed a commit to shyunMin/Xamarin.Forms that referenced this pull request Feb 19, 2021
Axemasta pushed a commit to Axemasta/Xamarin.Forms that referenced this pull request Apr 5, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Has two approvals, no pending reviews, and no changes requested p/WPF
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants