Bug 186025 [Viewers] Virtual Manager should be cleared when Viewer is disposed
Got a nasty memory leak where the Workbench would keep my disposed viewer in a field since it was registered as a selection provider. In StructuredViewer#handleDisposed(), the input is set to null, however this does not clear a possible virtual manager being used from the Table Viewer. The Table Viewer should clear the cache of the virtual manager on handleDispose to make sure, no reference to any model object is retained.
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/AbstractTableViewer.java
/**
		 * A non visible item has been added.
		 *
		 * @param element
		 * @param index
		 */
		public void notVisibleAdded(Object element, int index) {
			int requiredCount = doGetItemCount() + 1;
			Object[] newCache = new Object[requiredCount];
			System.arraycopy(cachedElements, 0, newCache, 0, index);
			if (index < cachedElements.length) {
				System.arraycopy(cachedElements, index, newCache, index + 1,
						cachedElements.length - index);
			}
			newCache[index] = element;
			cachedElements = newCache;
			doSetItemCount(requiredCount);
		}
		/**
		 * The elements with the given indices need to be removed from the
		 * cache.
		 *
		 * @param indices
		 */
		public void removeIndices(int[] indices) {
			if (indices.length == 1) {
				removeIndicesFromTo(indices[0], indices[0]);
			}
			int requiredCount = doGetItemCount() - indices.length;
			Arrays.sort(indices);