EditText native object was not disposed in Android
#3784 aperta il 14 set 2018
Metriche repository
- Star
- (5644 stelle)
- Metriche merge PR
- (Nessuna PR mergiata in 30 g)
Descrizione
Description
I have created a simple custom control in Android. I have inherits the native EditText. I have hooked only TextChanged event in the source. In the disposing method, I have unhooked the TextChanged event. Unfortunately, the memory of the native control was not cleared. If I commented on the TextChanged event, the native memory was cleared in Android.
Steps to Reproduce
- Run the attached sample
- Go to the Custom Control page and return back main page
- Check the Memory consumption on Android profiler
- The EditText object was not disposed in Android
Expected Behavior
The native EditText Object was disposed of if we return to the main page
Actual Behavior
The native EditText object was not disposed of if we hook the text changed event and retun back to the mainpage in Android
Basic Information
- Version with issue: Xamarin Forms version 3.0
- Last known good version:
- IDE: VS 2017
- Platform Target Frameworks:
- Android: 7.0
- Android Support Library Version: No
- Nuget Packages: No
- Affected Devices: Moto G4 plus
Screenshots

Reproduction Link
Reproduction Sample link: MemoryLeakSample.zip