Bug 142593 - Scrolling a table eventually locks up the entire application (back port to 3.3.2)
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Table.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Table.java index c162d18..32e6231 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Table.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Table.java
@@ -5843,22 +5843,6 @@ // if (drawCount != 0 || !OS.IsWindowVisible (handle)) break; NMLVDISPINFO plvfi = new NMLVDISPINFO (); OS.MoveMemory (plvfi, lParam, NMLVDISPINFO.sizeof); - - /* - * When an item is being deleted from a virtual table, do not - * allow the application to provide data for a new item that - * becomes visible until the item has been removed from the - * items array. Because arbitrary application code can run - * during the callback, the items array might be accessed - * in an inconsistent state. Rather than answering the data - * right away, queue a redraw for later. - */ - if ((style & SWT.VIRTUAL) != 0) { - if (ignoreShrink) { - OS.SendMessage (handle, OS.LVM_REDRAWITEMS, plvfi.iItem, plvfi.iItem); - break; - } - } /* * Feature in Windows. When a new table item is inserted @@ -5870,6 +5854,22 @@ */ TableItem item = _getItem (plvfi.iItem); if (item == null) break; + + /* + * When an item is being deleted from a virtual table, do not + * allow the application to provide data for a new item that + * becomes visible until the item has been removed from the + * items array. Because arbitrary application code can run + * during the callback, the items array might be accessed + * in an inconsistent state. Rather than answering the data + * right away, queue a redraw for later. + */ + if ((style & SWT.VIRTUAL) != 0 && !item.cached) { + if (ignoreShrink) { + OS.SendMessage (handle, OS.LVM_REDRAWITEMS, plvfi.iItem, plvfi.iItem); + break; + } + } /* * The cached flag is used by both virtual and non-virtual