Skip to content

Commit

Permalink
Merge pull request #525 from bewaapps/master
Browse files Browse the repository at this point in the history
ISSUE: In Release mode (1.4.0.6) doesn't work single instance option
  • Loading branch information
jimradford committed Aug 18, 2015
2 parents e88bcbe + bc73465 commit a33e884
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion SuperPutty/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ static class Program

private static bool EnforceSingleInstance = Convert.ToBoolean(
ConfigurationManager.AppSettings["SuperPuTTY.SingleInstance"] ?? "False");

//ISSUE: In Release mode (1.4.0.6) doesn't work single instance option
//FIX: declare mutex out of Main
private static Mutex mutex;

/// <summary>
/// The main entry point for the application.
Expand All @@ -53,7 +57,7 @@ static void Main(string[] args)
log4net.Config.BasicConfigurator.Configure();

bool onlyInstance = false;
Mutex mutex = new Mutex(true, "SuperPutty", out onlyInstance);
mutex = new Mutex(true, "SuperPutty", out onlyInstance);

Log.InfoFormat(
"IsFirstRun={0}, SingleInstanceMode={1}, onlyInstance={2}",
Expand Down

0 comments on commit a33e884

Please sign in to comment.