Skip to content

Commit

Permalink
Singleton implemented - greetings to gusmanb
Browse files Browse the repository at this point in the history
  • Loading branch information
wildwing1970 committed Jan 17, 2017
1 parent 39f2b7e commit 3cc8b54
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions PSVRToolbox/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@

using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.NetworkInformation;
using System.Net.Sockets;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Threading;

namespace PSVRToolbox
{
static class Program
{
static Mutex mutex = new Mutex(true, "PSVRToolbox");

/// <summary>
/// Punto de entrada principal para la aplicación.
/// </summary>
Expand Down Expand Up @@ -155,11 +155,13 @@ static void Main(string[] args)
return;
}

Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new MainForm());
if (mutex.WaitOne(TimeSpan.Zero, true))
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new MainForm());
mutex.ReleaseMutex();
}
}

}

}

0 comments on commit 3cc8b54

Please sign in to comment.