From ba860c76f77cf4c3dca3b22fc313a6201b848997 Mon Sep 17 00:00:00 2001 From: Eugene Zhuravlev Date: Mon, 11 Apr 2011 19:33:17 +0200 Subject: [PATCH] do not mark VFS corrupted if it is already disposed --- .../openapi/vfs/newvfs/persistent/FSRecords.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/persistent/FSRecords.java b/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/persistent/FSRecords.java index 49374531ff56..4e3414732678 100644 --- a/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/persistent/FSRecords.java +++ b/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/persistent/FSRecords.java @@ -91,6 +91,7 @@ public class FSRecords implements Forceable { private static final Object lock = new Object(); private static volatile int ourLocalModificationCount = 0; + private static volatile boolean ourIsDisposed; private static final int FREE_RECORD_FLAG = 0x100; private static final int ALL_VALID_FLAGS = PersistentFS.ALL_VALID_FLAGS | FREE_RECORD_FLAG; @@ -429,10 +430,13 @@ public class FSRecords implements Forceable { } private static RuntimeException handleError(final Throwable e) { - if (!myCorrupted) { - createBrokenMarkerFile(e); - myCorrupted = true; - force(); + if (!ourIsDisposed) { + // No need to forcibly mark VFS corrupted if it is already shut down + if (!myCorrupted) { + createBrokenMarkerFile(e); + myCorrupted = true; + force(); + } } return new RuntimeException(e); @@ -1190,6 +1194,9 @@ public class FSRecords implements Forceable { catch (Throwable e) { throw DbConnection.handleError(e); } + finally { + ourIsDisposed = true; + } } }