Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
Here is decompiled Xamarin.Forms.Platform.iOS.ListViewRenderer.Dispose() from Forms 1.5(1.4 is the same).
It just dispose viewTableCell, I think it should also dispose uiView itself in the loop, or there will be memory leak.
protected override void Dispose(bool disposing)
if (disposing && this.insetTracker != null)
this.insetTracker = null;
Stack<UIView> stack = new Stack<UIView>(this.Subviews);
while (stack.get_Count() > 0)
UIView uIView = stack.Pop();
ViewCellRenderer.ViewTableCell viewTableCell = uIView as ViewCellRenderer.ViewTableCell;
if (viewTableCell != null)
//SHOULD CALL: uIView.Dispose();
UIView subviews = uIView.Subviews;
for (int i = 0; i < subviews.Length; i++)
UIView uIView2 = subviews[i];
if (base.Element != null)
base.Element.TemplatedItems.CollectionChanged -= new NotifyCollectionChangedEventHandler(this.OnCollectionChanged);
base.Element.TemplatedItems.GroupedCollectionChanged -= new NotifyCollectionChangedEventHandler(this.OnGroupedCollectionChanged);
It's also not disposing the private footerRenderer or headerRenderer properties.
Also, in ListViewRenderer.UpdateHeader() and UpdateFooter() the MeasureInvalidated event handler is not unregistered when setting the header or footer to null when it was previously set. The handler is unregistered when setting the header or footer to a new view.
if (this.headerRenderer != null)
// I think it needs something like this.
if (this.headerRenderer.Element != null)
this.headerRenderer.Element.MeasureInvalidated -= this.OnHeaderMeasureInvalidated;
base.Control.TableHeaderView = null;
this.headerRenderer = null;
Should be fixed in 2.2.0-pre1
Hi, I to verify this issue, I have tried to reproduce this but not able to reproduce this. Could you please share a small sample application that demonstrate this issue. That would be very helpful to reproduce/verify this issue at our end.