Bug 44827 [Viewers] StructuredViewer's UpdateItemSafeRunnable holds onto last selected element-memory leak
I have a TableViewer that normally displays a list of objects. I clear the list by calling TableViewer.setInput(null). I found that if I initially have a list of objects, select an object, then setInput(null) the TableViewer is still holding onto an instance of the object I last selected. More specifically, it looks like StructuredViewer's UpdateItemSafeRunnable is holding onto the object. The UpdateItemSafeRunnable object should be cleared out after its use.
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/StructuredViewer.java
/**
	 * A map from the viewer's model elements to SWT widgets.
	 * (key type: <code>Object</code>, value type: <code>Widget</code>).
	 * <code>null</code> means that the element map is disabled.
	 */
	private CustomHashtable elementMap;
	/**
	 * The comparer to use for comparing elements,
	 * or <code>null</code> to use the default <code>equals</code>
	 * and <code>hashCode</code> methods on the element itself.
	 */
	private IElementComparer comparer;
		
	/**
	 * This viewer's sorter.
	 * <code>null</code> means there is no sorter.
	 */
	private ViewerSorter sorter;
	/**
	 * This viewer's filters (element type: <code>ViewerFilter</code>).
	 * <code>null</code> means there are no filters.
	 */
	private List filters;
	/**
	 * Indicates whether a selection change is in progress on this
	 * viewer.
	 *
	 * @see #setSelection(ISelection, boolean)
	 */