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
* 
	 * @see org.eclipse.core.commands.operations.IOperationHistory#add(org.eclipse.core.commands.operations.IUndoableOperation)
	 */
	public void add(IUndoableOperation operation) {
		Assert.isNotNull(operation);
		
		/*
		 * If we are in the middle of executing an open batching operation, and this is not that
		 * operation, then we need only add the context of the new operation to the batch.  
		 * The operation itself is disposed since we will never undo or redo it.  We consider
		 * it to be triggered by the batching operation and assume that its undo will be triggered
		 * by the batching operation undo.  
		 */
		if (batchingOperation != null && batchingOperation != operation) {
			IUndoContext[] contexts = operation.getContexts();
			for (int i = 0; i < contexts.length; i++) {
				batchingOperation.addContext(contexts[i]);
			}
			operation.dispose();
			return;
		}
		
		
		IUndoContext[] contexts = operation.getContexts();
		for (int i = 0; i < contexts.length; i++) {
			flushRedo(contexts[i]);
		}
		checkUndoLimit(operation);
		undoList.add(operation);
		notifyAdd(operation);