lhab
Joined: 13 Dec 2011 Posts: 2
|
Posted: Mon Jul 16, 2012 12:04 pm Post subject: reentrency issue with click events |
|
|
If, inside a CellDoubleClick event handler, I clear the list of items, I end up, after all mouse messages are processed, with a Disposed row (the one I double-clicked) as FocusRow and SelectedRow.
I got rid of this problem by overriding SelectRow, SetSelectedRow, SetFocusRow and FocusRow to do nothing if the argument Row is Disposed.
My guess is that you determine the clicked row, call various handlers (click, double click, mouse up) on it, and finally make it focused/selected without checking that it is still valid.
I think that, whenever you perform a sequence of actions on a row, and one of them is a a public event handler, you should check after calling the event that the row was not destroyed, and, if it was, interrupt the sequence. |
|