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
* </p>
 *
 * @param element the element
 */
protected void unmapElement(Object element) {
	if (elementMap != null) {
		elementMap.remove(element);
	}
}
/**
 * Removes the given association from the internal element to widget map.
 * Does nothing if mapping is disabled, or if the given element does not map
 * to the given item.
 * <p>
 * This method is internal to the framework; subclassers should not call
 * this method.
 * </p>
 *
 * @param element the element
 * @since 2.0
 */
protected void unmapElement(Object element, Widget item) {
	
	if (elementMap != null && elementMap.get(element) == item) {
		
		unmapElement(element);
	}
}
/**
 * Updates the given elements' presentation when one or more of their properties change.