diff options
author | Grant Gayed <grant_gayed@ca.ibm.com> | 2012-08-30 05:08:37 -0400 |
---|---|---|
committer | Grant Gayed <grant_gayed@ca.ibm.com> | 2012-08-30 05:09:42 -0400 |
commit | 0ffd76f04d04c924c21c761e53a4e547cd5ce501 (patch) | |
tree | 24f00a7117c29e7cae1fe24ac5dba9a01ee13ee2 /bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java | |
parent | f161484e8ba50495a84a24c63f2849d4a2a53fb6 (diff) | |
download | eclipse.platform.swt-0ffd76f04d04c924c21c761e53a4e547cd5ce501.tar.gz eclipse.platform.swt-0ffd76f04d04c924c21c761e53a4e547cd5ce501.tar.xz eclipse.platform.swt-0ffd76f04d04c924c21c761e53a4e547cd5ce501.zip |
Bug 381407 - reproducible crash in Debug's Variables view (ppc64)
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java')
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java index 68a5709493..3aca800842 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java @@ -511,6 +511,7 @@ void createColumn (TableColumn column, int index) { int /*long*/ newModel = OS.gtk_list_store_newv (types.length, types); if (newModel == 0) error (SWT.ERROR_NO_HANDLES); int /*long*/ [] ptr = new int /*long*/ [1]; + int [] ptr1 = new int [1]; for (int i=0; i<itemCount; i++) { int /*long*/ newItem = OS.g_malloc (OS.GtkTreeIter_sizeof ()); if (newItem == 0) error (SWT.ERROR_NO_HANDLES); @@ -518,7 +519,12 @@ void createColumn (TableColumn column, int index) { TableItem item = items [i]; if (item != null) { int /*long*/ oldItem = item.handle; - for (int j=0; j<modelLength; j++) { + /* the first three columns contain int values, subsequent columns contain pointers */ + for (int j=0; j<3; j++) { + OS.gtk_tree_model_get (oldModel, oldItem, j, ptr1, -1); + OS.gtk_list_store_set (newModel, newItem, j, ptr1 [0], -1); + } + for (int j=3; j<modelLength; j++) { OS.gtk_tree_model_get (oldModel, oldItem, j, ptr, -1); OS.gtk_list_store_set (newModel, newItem, j, ptr [0], -1); if (types [j] == OS.G_TYPE_STRING ()) { @@ -948,6 +954,7 @@ void destroyItem (TableColumn column) { int /*long*/ newModel = OS.gtk_list_store_newv (types.length, types); if (newModel == 0) error (SWT.ERROR_NO_HANDLES); int /*long*/ [] ptr = new int /*long*/ [1]; + int [] ptr1 = new int [1]; for (int i=0; i<itemCount; i++) { int /*long*/ newItem = OS.g_malloc (OS.GtkTreeIter_sizeof ()); if (newItem == 0) error (SWT.ERROR_NO_HANDLES); @@ -955,7 +962,12 @@ void destroyItem (TableColumn column) { TableItem item = items [i]; if (item != null) { int /*long*/ oldItem = item.handle; - for (int j=0; j<FIRST_COLUMN; j++) { + /* the first three columns contain int values, subsequent columns contain pointers */ + for (int j=0; j<3; j++) { + OS.gtk_tree_model_get (oldModel, oldItem, j, ptr1, -1); + OS.gtk_list_store_set (newModel, newItem, j, ptr1 [0], -1); + } + for (int j=3; j<FIRST_COLUMN; j++) { OS.gtk_tree_model_get (oldModel, oldItem, j, ptr, -1); OS.gtk_list_store_set (newModel, newItem, j, ptr [0], -1); if (ptr [0] != 0) { |