Removed global from mutex

This commit is contained in:
Jaex 2014-01-14 12:09:50 +02:00
parent b9fe26eb57
commit db645ae5f7

View file

@ -29,6 +29,7 @@ You should have received a copy of the GNU General Public License
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading;
using System.Windows.Forms;
@ -241,12 +242,10 @@ private static void Main(string[] args)
private static void Run(string[] args)
{
Mutex mutex = null;
string appGuid = ((GuidAttribute)Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(GuidAttribute), false).GetValue(0)).Value.ToString();
try
using (Mutex mutex = new Mutex(false, appGuid)) // Required for installer
{
mutex = new Mutex(false, @"Global\82E6AC09-0FEF-4390-AD9F-0DD3F5561EFC"); // Required for installer
IsSilentRun = CLIHelper.CheckArgs(args, "silent", "s");
IsSandbox = CLIHelper.CheckArgs(args, "sandbox");
@ -300,13 +299,6 @@ private static void Run(string[] args)
DebugHelper.WriteLine("ShareX closing");
DebugHelper.Logger.SaveLog(LogFilePath);
}
finally
{
if (mutex != null)
{
mutex.Close();
}
}
}
public static void LoadSettings()