Project: SWT
Bug 39443 GTK Error calling TreeItem.getExpanded() on a tree item being disposed.
Reported: 2003-06-27 16:09:03 | Status: resolved fixed

Here's a simple test case that works just fine on Motif, Windows and OS X, but crashes on GTK. We do something similar in GEF and it crashes the entire workbench -- I couldn't find anything in the log or console that even showed an error occured. This test case here shows the following error message in the console: Gtk-ERROR **: file gtktreestore.c: line 576 (gtk_tree_store_get_path): assertion failed: (G_NODE (iter->user_data)->parent != NULL) import org.eclipse.swt.SWT; import org.eclipse.swt.events.DisposeEvent; import org.eclipse.swt.events.DisposeListener; import org.eclipse.swt.widgets.*; public class TreeTest { public static void main(String[] args) { Shell shell = new Shell(); Tree tree = new Tree(shell, SWT.NONE); final TreeItem item1 = new TreeItem(tree, SWT.NONE); item1.setText("Item 1"); item1.addDisposeListener(new DisposeListener() { public void widgetDisposed(DisposeEvent e) { boolean expanded = item1.getExpanded(); } }); tree.removeAll(); shell.open(); Display display = Display.getDefault(); while (!shell.isDisposed()) if (!display.readAndDispatch()) display.sleep(); display.dispose(); } }

Files changed in fix:
bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java