From 032721721e5a61fc56a8e6cdc454700c34588ee0 Mon Sep 17 00:00:00 2001 From: Bogdan Gheorghe Date: Tue, 17 Jul 2007 19:05:35 +0000 Subject: 167562 SIGSEGV in Tree#destroyItem() --- .../Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java | 15 +-------------- .../Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java | 15 +-------------- 2 files changed, 2 insertions(+), 28 deletions(-) (limited to 'bundles/org.eclipse.swt') 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 7f6316d0d6..7657f94474 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 @@ -2337,22 +2337,9 @@ public void removeAll () { } items = new TableItem [4]; itemCount = 0; - - /* - * Bug in GTK. In version 2.3.2, when the property fixed-height-mode - * is set and there are items in the list, OS.gtk_list_store_clear() - * segment faults. The fix is to create a new empty model instead. - */ int /*long*/ selection = OS.gtk_tree_view_get_selection (handle); OS.g_signal_handlers_block_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, CHANGED); -// OS.gtk_list_store_clear (modelHandle); - int /*long*/ oldModel = modelHandle; - int /*long*/[] types = getColumnTypes (Math.max (1,columnCount)); - int /*long*/ newModel = OS.gtk_list_store_newv (types.length, types); - if (newModel == 0) error (SWT.ERROR_NO_HANDLES); - OS.gtk_tree_view_set_model (handle, newModel); - OS.g_object_unref (oldModel); - modelHandle = newModel; + OS.gtk_list_store_clear (modelHandle); OS.g_signal_handlers_unblock_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, CHANGED); resetCustomDraw (); 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 8c983903d0..2f0c64ab68 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 @@ -2274,22 +2274,9 @@ public void removeAll () { if (item != null && !item.isDisposed ()) item.release (false); } items = new TreeItem[4]; - /* - * Bug in GTK. In version 2.3.2, when the property fixed-height-mode - * is set and there are items in the list, OS.gtk_tree_store_clear() - * segment faults. The fix is to create a new empty model instead. - */ int /*long*/ selection = OS.gtk_tree_view_get_selection (handle); OS.g_signal_handlers_block_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, CHANGED); - // TODO verify if true for tree store - //OS.gtk_tree_store_clear (modelHandle); - int /*long*/ oldModel = modelHandle; - int /*long*/[] types = getColumnTypes (Math.max (1,columnCount)); - int /*long*/ newModel = OS.gtk_tree_store_newv (types.length, types); - if (newModel == 0) error (SWT.ERROR_NO_HANDLES); - OS.gtk_tree_view_set_model (handle, newModel); - OS.g_object_unref (oldModel); - modelHandle = newModel; + OS.gtk_tree_store_clear (modelHandle); OS.g_signal_handlers_unblock_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, CHANGED); /* Disable searching when using VIRTUAL */ -- cgit