Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
coenm committed Sep 4, 2024
1 parent 6fcdec1 commit 77465b8
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions src/RepoM.App/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ namespace RepoM.App;
using RepoM.App.i18n;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
using Microsoft.VisualStudio.Services.WebApi;
using RepoM.Api.Plugins;
using RepoM.App.Plugins;
using Serilog;
Expand Down Expand Up @@ -116,7 +115,7 @@ protected override void OnExit(ExitEventArgs e)

// #pragma warning disable CA1416 // Validate platform compatibility
_notifyIcon?.Dispose();
// #pragma warning restore CA1416 // Validate platform compatibility
// #pragma warning restore CA1416 // Validate platform compatibility

ReleaseAndDisposeMutex();

Expand Down Expand Up @@ -160,25 +159,23 @@ private static void UseRepositoryMonitor(Container container)

private static bool IsAlreadyRunning()
{
bool createdNew;

try
{
_mutex = new Mutex(true, "Local\\github.com/coenm/RepoM", out createdNew);
_mutex = new Mutex(true, "Local\\github.com/coenm/RepoM", out var createdNew);

if (createdNew)
{
return false;
}
}
catch (Exception)
{
return true;
}

if (!createdNew)
{
_mutex.Dispose();
_mutex = null;
return true;
}

return false;
_mutex.Dispose();
_mutex = null;
return true;
}

private static void ReleaseAndDisposeMutex()
Expand Down

0 comments on commit 77465b8

Please sign in to comment.