Merge pull request #81 from ericsink/master
attempt to properly unsubscribe the click handler for List cells.
This commit is contained in:
commit
4ef14afc7f
|
@ -48,6 +48,8 @@ namespace Ooui.Forms.Renderers
|
|||
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
UnsubscribeCellClicks();
|
||||
|
||||
base.Dispose(disposing);
|
||||
|
||||
if (disposing && !_disposed)
|
||||
|
@ -56,8 +58,17 @@ namespace Ooui.Forms.Renderers
|
|||
}
|
||||
}
|
||||
|
||||
private void UnsubscribeCellClicks()
|
||||
{
|
||||
foreach (var c in _cells)
|
||||
{
|
||||
c.Click -= ListItem_Click;
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateItems()
|
||||
{
|
||||
UnsubscribeCellClicks();
|
||||
_cells.Clear();
|
||||
|
||||
var items = TemplatedItemsView.TemplatedItems;
|
||||
|
|
Loading…
Reference in New Issue