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

Commit

Permalink
[iOS] Fix NRE when re-adding header/footer (#702)
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmgarrido authored and rmarinho committed Jan 21, 2017
1 parent a11e4c6 commit c9b384c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Xamarin.Forms.Platform.iOS/Renderers/ListViewRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,8 @@ void UpdateFooter()
else if (_footerRenderer != null)
{
Control.TableFooterView = null;
_footerRenderer.Element.MeasureInvalidated -= OnFooterMeasureInvalidated;

var platform = _footerRenderer.Element.Platform as Platform;
if (platform != null)
platform.DisposeModelAndChildrenRenderers(_footerRenderer.Element);
Expand Down Expand Up @@ -458,6 +460,8 @@ void UpdateHeader()
else if (_headerRenderer != null)
{
Control.TableHeaderView = null;
_headerRenderer.Element.MeasureInvalidated -= OnHeaderMeasureInvalidated;

var platform = _headerRenderer.Element.Platform as Platform;
if (platform != null)
platform.DisposeModelAndChildrenRenderers(_headerRenderer.Element);
Expand Down

0 comments on commit c9b384c

Please sign in to comment.