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
* call <code>internalRefresh(element, true)</code>.
 * 
 * @param element the element
 * @param updateLabels <code>true</code> to update labels for existing elements,
 * <code>false</code> to only update labels as needed, assuming that labels
 * for existing elements are unchanged.
 * 
 * @since 2.0
 */
protected void internalRefresh(Object element, boolean updateLabels) {
	internalRefresh(element);
}
/**
 * Adds the element item pair to the element map.
 * <p>
 * This method is internal to the framework; subclassers should not call
 * this method.
 * </p>
 *
 * @param element the element
 * @param item the corresponding widget
 */
protected void mapElement(Object element, Widget item) {
	if (elementMap != null)
		elementMap.put(element, item);
}
/**
 * Determines whether a change to the given property of the given element
 * would require refiltering and/or resorting.
 * <p>