mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
platform: synchronize access to ModuleRootManagerImpl.myModelCreations
'getModifiableModel' requires read access only so it may be invoked concurrently.
This commit is contained in:
+11
-4
@@ -89,8 +89,11 @@ public class ModuleRootManagerImpl extends ModuleRootManager implements Disposab
|
||||
myIsDisposed = true;
|
||||
|
||||
if (Disposer.isDebugMode()) {
|
||||
final Set<Map.Entry<RootModelImpl, Throwable>> entries = myModelCreations.entrySet();
|
||||
for (final Map.Entry<RootModelImpl, Throwable> entry : new ArrayList<>(entries)) {
|
||||
List<Map.Entry<RootModelImpl, Throwable>> entries;
|
||||
synchronized (myModelCreations) {
|
||||
entries = new ArrayList<>(myModelCreations.entrySet());
|
||||
}
|
||||
for (final Map.Entry<RootModelImpl, Throwable> entry : entries) {
|
||||
System.err.println("***********************************************************************************************");
|
||||
System.err.println("*** R O O T M O D E L N O T D I S P O S E D ***");
|
||||
System.err.println("***********************************************************************************************");
|
||||
@@ -115,7 +118,9 @@ public class ModuleRootManagerImpl extends ModuleRootManager implements Disposab
|
||||
public void dispose() {
|
||||
super.dispose();
|
||||
if (Disposer.isDebugMode()) {
|
||||
myModelCreations.remove(this);
|
||||
synchronized (myModelCreations) {
|
||||
myModelCreations.remove(this);
|
||||
}
|
||||
}
|
||||
|
||||
for (OrderEntry entry : ModuleRootManagerImpl.this.getOrderEntries()) {
|
||||
@@ -124,7 +129,9 @@ public class ModuleRootManagerImpl extends ModuleRootManager implements Disposab
|
||||
}
|
||||
};
|
||||
if (Disposer.isDebugMode()) {
|
||||
myModelCreations.put(model, new Throwable());
|
||||
synchronized (myModelCreations) {
|
||||
myModelCreations.put(model, new Throwable());
|
||||
}
|
||||
}
|
||||
return model;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user