void (@NotNull Document document) { ThreadingAssertions.assertEventDispatchThread(); for (ClientState state : getAllClientStates()) { state.myUndoStacksHolder.clearDocumentReferences(document); state.myRedoStacksHolder.clearDocumentReferences(document); state.myMerger.clearDocumentReferences(document); } mySharedUndoStacksHolder.clearDocumentReferences(document); mySharedRedoStacksHolder.clearDocumentReferences(document); }