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
*
 * @param parent the parent element
 * @return a filtered array of child elements
 */
protected Object[] getFilteredChildren(Object parent) {
	Object[] result = getRawChildren(parent);
	if (filters != null) {
		for (Iterator iter = filters.iterator(); iter.hasNext();) {
			ViewerFilter f = (ViewerFilter) iter.next();
			result = f.filter(this, parent, result);
		}
	}
	return result;
}
/**
 * Returns this viewer's filters.
 *
 * @return an array of viewer filters
 */
public ViewerFilter[] getFilters() {
	if (filters == null)
		return new ViewerFilter[0];
	ViewerFilter[] result = new ViewerFilter[filters.size()];
	filters.toArray(result);
	return result;
}
/**
 * Returns the item at the given display-relative coordinates, or
 * <code>null</code> if there is no item at that location.
 * <p>