mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
drop memory caches only when is dirty
This commit is contained in:
+3
-1
@@ -34,7 +34,9 @@ public abstract class AbstractStateStorage<Key, T> {
|
||||
|
||||
public void dropMemoryCache() {
|
||||
synchronized (myDataLock) {
|
||||
myMap.dropMemoryCaches();
|
||||
if (myMap.isDirty()) {
|
||||
myMap.dropMemoryCaches();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -108,7 +108,9 @@ public class PersistentMaplet<K, V> implements Maplet<K, V> {
|
||||
|
||||
public void flush(boolean memoryCachesOnly) {
|
||||
if (memoryCachesOnly) {
|
||||
myMap.dropMemoryCaches();
|
||||
if (myMap.isDirty()) {
|
||||
myMap.dropMemoryCaches();
|
||||
}
|
||||
}
|
||||
else {
|
||||
myMap.force();
|
||||
|
||||
@@ -169,7 +169,9 @@ class PersistentMultiMaplet<K, V> implements MultiMaplet<K, V> {
|
||||
|
||||
public void flush(boolean memoryCachesOnly) {
|
||||
if (memoryCachesOnly) {
|
||||
myMap.dropMemoryCaches();
|
||||
if (myMap.isDirty()) {
|
||||
myMap.dropMemoryCaches();
|
||||
}
|
||||
}
|
||||
else {
|
||||
myMap.force();
|
||||
|
||||
Reference in New Issue
Block a user