Bug 19567

Summary: DataGridView crashes on Dispose when cell is in edit mode
Product: [Mono] Class Libraries Reporter: eb1
Component: Windows.FormsAssignee: Bugzilla <bugzilla>
Status: RESOLVED FIXED    
Severity: normal CC: mono-bugs+mono
Priority: ---    
Version: 3.4.0   
Target Milestone: Untriaged   
Hardware: PC   
OS: Linux   
Tags: Is this bug a regression?: ---
Last known good build:

Description eb1 2014-05-06 12:51:59 UTC
Calling Dispose on a DataGridView will crash if a cell happens to be in edit mode.

To reproduce, run the following unit test:

		private class MyDataGridView: DataGridView
		{
			public void SetCurrentCell ()
			{
				CurrentCell = Rows [1].Cells [1];
			}
		}
		[Test]
		public void TestDisposeWhenInEditMode ()
		{
			var dgv = new MyDataGridView ();
			dgv.EditMode = DataGridViewEditMode.EditOnEnter;
			dgv.Columns.Add ("TestColumn", "Test column");
			dgv.Columns.Add ("Column2", "Second column");
			dgv.Rows.Add ();
			dgv.Rows.Add ();
			dgv.SetCurrentCell ();
			dgv.Dispose ();
		}
Comment 1 eb1 2014-05-06 13:11:39 UTC
Suggested fix in PR #1018
Comment 2 eb1 2014-05-06 17:40:08 UTC
Merged in master 41858f8