Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen McConnel <stephen_mcconnel@sil.org>2014-10-03 22:09:10 +0400
committerStephen McConnel <stephen_mcconnel@sil.org>2014-10-03 22:09:10 +0400
commit82093256f483cdd1ac01c20f1cb9058d3c5036af (patch)
tree38e21fdf1e83afbed089dbab4e44f480991f85e4 /mcs/class/Managed.Windows.Forms/System.Windows.Forms
parentb0cff959e47c3d9955e6675364bf71404cd74bac (diff)
Fix potential crash in ListView.ItemControl.ItemsMouseDown
This fixes Xamarin bug 23591. Side-effects of internal processing of ItemsMouseDown can cause ItemsMouseUp before ItemsMouseUp has finished.
Diffstat (limited to 'mcs/class/Managed.Windows.Forms/System.Windows.Forms')
-rw-r--r--mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListView.cs5
1 files changed, 5 insertions, 0 deletions
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListView.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListView.cs
index 3af4684710a..73d7a837d2b 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListView.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListView.cs
@@ -2668,6 +2668,11 @@ namespace System.Windows.Forms
owner.UpdateMultiSelection (clicked_item.DisplayIndex, reselect);
} else {
clicked_item.Selected = true;
+ // Side-effects to setting Selected can possibly result in ItemsMouseUp() being called
+ // and clicked_item being set to null. (See Xamarin bug 23591.) In such a case, assume
+ // that there's nothing more we can do here.
+ if (clicked_item == null)
+ return;
}
if (owner.VirtualMode && changed) {