mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[Workspace model] Dispose modifiable model without libraries to remove
GitOrigin-RevId: 84abeee4291685ddfa755705aa3896cef211472e
This commit is contained in:
committed by
intellij-monorepo-bot
parent
60c469e5e6
commit
2e05d1ba18
+10
-1
@@ -340,7 +340,7 @@ class LegacyBridgeModifiableRootModel(
|
||||
LegacyBridgeModuleRootComponent.getInstance(module).newModuleLibraries.addAll(moduleLibraryTable.librariesToAdd)
|
||||
// Do not clear `librariesToAdd`. Otherwise `getLibraries()` will return an empty list after the commit
|
||||
|
||||
dispose()
|
||||
disposeSkippingLibraries()
|
||||
|
||||
val moduleDiff = module.diff
|
||||
|
||||
@@ -365,6 +365,15 @@ class LegacyBridgeModifiableRootModel(
|
||||
modelIsCommittedOrDisposed = true
|
||||
}
|
||||
|
||||
private fun disposeSkippingLibraries() {
|
||||
if (!modelIsCommittedOrDisposed) {
|
||||
Disposer.dispose(extensionsDisposable)
|
||||
}
|
||||
|
||||
// No assertions here since it is ok to call dispose twice or more
|
||||
modelIsCommittedOrDisposed = true
|
||||
}
|
||||
|
||||
override fun getModuleLibraryTable(): LibraryTable = moduleLibraryTable
|
||||
|
||||
override fun setSdk(jdk: Sdk?) {
|
||||
|
||||
Reference in New Issue
Block a user