diff options
author | Grant Gayed <grant_gayed@ca.ibm.com> | 2011-12-22 12:30:32 -0500 |
---|---|---|
committer | Grant Gayed <grant_gayed@ca.ibm.com> | 2011-12-22 12:30:32 -0500 |
commit | 1585ebb14115790898593946bf9938c97f5e76f5 (patch) | |
tree | 0dee44e6aadef5a0ef691cebb851340353dbcf2a /bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/List.java | |
parent | afd2596f7d0b684f40a6cde49ffd8b1e1885b748 (diff) | |
download | eclipse.platform.swt-1585ebb14115790898593946bf9938c97f5e76f5.tar.gz eclipse.platform.swt-1585ebb14115790898593946bf9938c97f5e76f5.tar.xz eclipse.platform.swt-1585ebb14115790898593946bf9938c97f5e76f5.zip |
Bug 367414 - Table#getSelection() throws an AIOOBE
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/List.java')
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/List.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/List.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/List.java index 7c475acee0..5edfc18fec 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/List.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/List.java @@ -621,15 +621,15 @@ public int getSelectionIndex () { for (int i=0; i<count; i++) { int /*long*/ data = OS.g_list_nth_data (list, i); int /*long*/ indices = OS.gtk_tree_path_get_indices (data); - OS.gtk_tree_path_free (data); if (indices != 0) { OS.memmove (index, indices, 4); - for (int j = i + 1; j < count; j++) { + for (int j = i; j < count; j++) { data = OS.g_list_nth_data (list, j); OS.gtk_tree_path_free (data); } break; } + OS.gtk_tree_path_free (data); } OS.g_list_free (list); return index [0]; @@ -680,13 +680,13 @@ public int [] getSelectionIndices () { for (int i=0; i<count; i++) { int /*long*/ data = OS.g_list_nth_data (list, i); int /*long*/ indices = OS.gtk_tree_path_get_indices (data); - OS.gtk_tree_path_free (data); if (indices != 0) { int [] index = new int [1]; OS.memmove (index, indices, 4); treeSelection [length] = index [0]; length++; } + OS.gtk_tree_path_free (data); } OS.g_list_free (list); int [] result = new int [length]; |