Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/DiffEngine/Tray/DiffEngineTray.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ static DiffEngineTray()
catch (IOException)
{
}
// A mutex that exists but is not accessible to this caller, which Mutex.TryOpenExisting
// documents: the tray under one account and the tests under another. Uncaught in a static
// constructor it is far worse than a wrong answer - the type never initialises, so every
// later DiffRunner.Launch and AddDelete in the process throws TypeInitializationException
catch (UnauthorizedAccessException)
{
}
}

public static bool IsRunning { get; internal set; }
Expand Down
7 changes: 7 additions & 0 deletions src/DiffEngine/Tray/TrayDetector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ public static bool IsRunning()
catch (IOException)
{
}
// Documented for a mutex that exists but cannot be opened by this caller: the tray running
// under one account and the tests under another in the same session. "Not accessible" is
// not "not running", but from here there is nothing to tell them apart with, and the
// answer that keeps a diff tool launching is the one to take
catch (UnauthorizedAccessException)
{
}

return false;
}
Expand Down
Loading