void () { ApplicationManager.getApplication().assertWriteIntentLockAcquired(); assert !myDisposed : "Already disposed!"; myDisposed = true; for (ModifiableRootModel each: myModifiableRootModels.values()) { if (each.isDisposed()) continue; each.dispose(); } Disposer.dispose(getModifiableProjectLibrariesModel()); for (Library.ModifiableModel each: myModifiableLibraryModels.values()) { if (each instanceof LibraryEx && ((LibraryEx)each).isDisposed()) continue; Disposer.dispose(each); } if (myModifiableModuleModel != null && myModifiableModuleModel.isChanged()) { myModifiableModuleModel.dispose(); } myModifiableModels.values().forEach(ModifiableModel::dispose); myModifiableRootModels.clear(); myModifiableFacetModels.clear(); myModifiableLibraryModels.clear(); myUserData.clear(); }