summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSilenio Quarti <silenio_quarti@ca.ibm.com>2012-09-05 22:58:45 -0400
committerSilenio Quarti <silenio_quarti@ca.ibm.com>2012-09-05 22:58:45 -0400
commitcce2597307b6e46e6f5e666c978d0b2de6c62776 (patch)
tree67868556b07be975160d043156b425c3495414b1
parent001a26d56e2c5f6288db0d3f1cb8c5f85fea05dc (diff)
downloadeclipse.platform.swt-cce2597307b6e46e6f5e666c978d0b2de6c62776.tar.gz
eclipse.platform.swt-cce2597307b6e46e6f5e666c978d0b2de6c62776.tar.xz
eclipse.platform.swt-cce2597307b6e46e6f5e666c978d0b2de6c62776.zip
Bug 381407 - reproducible crash in Debug's Variables view (PPC64)
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java8
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java23
2 files changed, 16 insertions, 15 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 58ea05420f..1b5268fc64 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
@@ -527,10 +527,10 @@ void createColumn (TableColumn column, int index) {
for (int j=FOREGROUND_COLUMN; 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 ()) {
- OS.g_free ((ptr [0]));
- } else if (ptr [0] != 0) {
- if (types [j] == OS.GDK_TYPE_COLOR()) {
+ if (ptr [0] != 0) {
+ if (types [j] == OS.G_TYPE_STRING ()) {
+ OS.g_free ((ptr [0]));
+ } else if (types [j] == OS.GDK_TYPE_COLOR()) {
OS.gdk_color_free (ptr [0]);
} else if (types [j] == OS.GDK_TYPE_PIXBUF()) {
OS.g_object_unref (ptr [0]);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java
index 673b967bae..5e46995039 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java
@@ -572,10 +572,10 @@ void copyModel (int /*long*/ oldModel, int oldStart, int /*long*/ newModel, int
for (int j = FOREGROUND_COLUMN; j < FIRST_COLUMN; j++) {
OS.gtk_tree_model_get (oldModel, oldItem, j, ptr, -1);
OS.gtk_tree_store_set (newModel, newItem, j, ptr [0], -1);
- if (types [j] == OS.G_TYPE_STRING ()) {
- OS.g_free ((ptr [0]));
- } else if (ptr[0] != 0) {
- if (types[j] == OS.GDK_TYPE_COLOR()) {
+ if (ptr [0] != 0) {
+ if (types [j] == OS.G_TYPE_STRING ()) {
+ OS.g_free ((ptr [0]));
+ } else if (types[j] == OS.GDK_TYPE_COLOR()) {
OS.gdk_color_free(ptr[0]);
} else if (types[j] == OS.GDK_TYPE_PIXBUF()) {
OS.g_object_unref(ptr[0]);
@@ -585,16 +585,17 @@ void copyModel (int /*long*/ oldModel, int oldStart, int /*long*/ newModel, int
}
}
for (int j= 0; j<modelLength - FIRST_COLUMN; j++) {
+ int newIndex = newStart + j;
OS.gtk_tree_model_get (oldModel, oldItem, oldStart + j, ptr, -1);
- OS.gtk_tree_store_set (newModel, newItem, newStart + j, ptr [0], -1);
- if (types [j] == OS.G_TYPE_STRING ()) {
- OS.g_free ((ptr [0]));
- } else if (ptr[0] != 0) {
- if (types[j] == OS.GDK_TYPE_COLOR()) {
+ OS.gtk_tree_store_set (newModel, newItem, newIndex, ptr [0], -1);
+ if (ptr[0] != 0) {
+ if (types [newIndex] == OS.G_TYPE_STRING ()) {
+ OS.g_free ((ptr [0]));
+ } else if (types[newIndex] == OS.GDK_TYPE_COLOR()) {
OS.gdk_color_free(ptr[0]);
- } else if (types[j] == OS.GDK_TYPE_PIXBUF()) {
+ } else if (types[newIndex] == OS.GDK_TYPE_PIXBUF()) {
OS.g_object_unref(ptr[0]);
- } else if (types[j] == OS.PANGO_TYPE_FONT_DESCRIPTION()) {
+ } else if (types[newIndex] == OS.PANGO_TYPE_FONT_DESCRIPTION()) {
OS.pango_font_description_free(ptr[0]);
}
}