From 6d5230ff1b1eb0efc69c177514bc29faaf1d1be1 Mon Sep 17 00:00:00 2001 From: Roman Shevchenko Date: Mon, 7 Jan 2013 16:10:01 +0100 Subject: [PATCH] PY-8414 (don't restart file watcher on hangup signal) --- .../intellij/openapi/vfs/impl/local/FileWatcher.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/openapi/vfs/impl/local/FileWatcher.java b/platform/platform-impl/src/com/intellij/openapi/vfs/impl/local/FileWatcher.java index 8fa592866b1e..fed93b9e42ba 100644 --- a/platform/platform-impl/src/com/intellij/openapi/vfs/impl/local/FileWatcher.java +++ b/platform/platform-impl/src/com/intellij/openapi/vfs/impl/local/FileWatcher.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2012 JetBrains s.r.o. + * Copyright 2000-2013 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -183,7 +183,13 @@ public class FileWatcher { } private void startupProcess(final boolean restart) throws IOException { - if (myIsShuttingDown) return; + if (myIsShuttingDown) { + return; + } + if (ShutDownTracker.isShutdownHookRunning()) { + myIsShuttingDown = true; + return; + } if (myStartAttemptCount++ > MAX_PROCESS_LAUNCH_ATTEMPT_COUNT) { notifyOnFailure(ApplicationBundle.message("watcher.failed.to.start"), null);