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

[Android] Remove listeners on dispose #13569

Merged
merged 1 commit into from
Feb 4, 2021

Conversation

kvpt
Copy link
Contributor

@kvpt kvpt commented Jan 28, 2021

Description of Change

When disposing renderers the framework need to unsubscribe events,
because of the different lifetime between the two parts this often cause memory leaks and dispose issues.
For the DotNet part the form is an event with +=/-=, in several past PR I fixed some missing calls of this form.
But for Android part the form is different, it's SetListener or AddListener, and RemoveListener.
I have checked Android renderers code and found that some renderers lack the removal of the setted listeners.
The goal of this PR is to add the missing ones.

Issues Resolved

  • fixes #

API Changes

None

Platforms Affected

  • Android

Behavioral/Visual Changes

None

Before/After Screenshots

Not applicable

Testing Procedure

As always with dispose and memory leaks issues, not possible to directly test it, just check if current tests not regress.

PR Checklist

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

@rmarinho
Copy link
Member

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@rmarinho rmarinho merged commit 2289789 into xamarin:5.0.0 Feb 4, 2021
@samhouts samhouts added this to the 5.0.0 milestone Feb 12, 2021
@kvpt kvpt deleted the fix-dispose-listeners branch December 10, 2021 19:04
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants