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 element the element to reveal
 */
public abstract void reveal(Object element);
/**
 * The <code>StructuredViewer</code> implementation of this method
 * checks to ensure that the content provider is an <code>IStructuredContentProvider</code>.
 */
public void setContentProvider(IContentProvider provider) {
	Assert.isTrue(provider instanceof IStructuredContentProvider);
	super.setContentProvider(provider);
}
/* (non-Javadoc)
 * Method declared in Viewer.
 * This implementatation additionaly unmaps all the elements.
 */
public final void setInput(Object input) {
		
	try {
		
		unmapAllElements();
		super.setInput(input);
	} finally {
	}
}
/**
 * The <code>StructuredViewer</code> implementation of this method does the following.
 * <p>
 * If the new selection differs from the current
 * selection the hook <code>updateSelection</code> is called.
 * </p>