mirror of
https://github.com/ShareX/ShareX.git
synced 2024-09-30 01:07:21 +13:00
Removed global from mutex
This commit is contained in:
parent
b9fe26eb57
commit
db645ae5f7
1 changed files with 3 additions and 11 deletions
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue