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
this.comparer = comparer;
	if (elementMap != null) {
		elementMap = new CustomHashtable(elementMap, comparer);
	}
}
/**
 * Hook for testing.
 */
public Widget testFindItem(Object element) {
	return findItem(element);
}
/**
 * Removes all elements from the map.
 * <p>
 * This method is internal to the framework; subclassers should not call
 * this method.
 * </p>
 */
protected void unmapAllElements() {
	if (elementMap != null) {
		elementMap = new CustomHashtable(comparer);
	}
}
/**
 * Removes the given element from the internal element to widget map.
 * Does nothing if mapping is disabled.
 * If mapping is enabled, the given element must be present.
 * <p>
 * This method is internal to the framework; subclassers should not call
 * this method.