Bug 88352 Operation supports leaks contexts via action handler
I20050315-1100 Susan, this is a different leak from the one that I reported. Test Case: 1. open text editor 2. close text editor ==> DefaultUndoManager is leaked due to undo/redo actions handlers still holding on to the context.
bundles/org.eclipse.core.commands/src/org/eclipse/core/commands/operations/DefaultOperationHistory.java
*/
	void flushRedo(IUndoContext context) {
		Object[] filtered = filter(redoList, context);
		for (int i = 0; i < filtered.length; i++) {
			IUndoableOperation operation = (IUndoableOperation) filtered[i];
			if (context == GLOBAL_UNDO_CONTEXT || operation.getContexts().length == 1) {
				
				redoList.remove(operation);
				internalRemove(operation);
			} else {
				
				operation.removeContext(context);
			}
		}
	}
	
	/*
	 * Flush the undo stack of all operations that have the given context.
	 */
	void flushUndo(IUndoContext context) {
		Object[] filtered = filter(undoList, context);
		for (int i = 0; i < filtered.length; i++) {
			IUndoableOperation operation = (IUndoableOperation) filtered[i];
			if (context == GLOBAL_UNDO_CONTEXT || operation.getContexts().length == 1) {
				
				undoList.remove(operation);
				internalRemove(operation);
			} else {
				
				operation.removeContext(context);