From f4ff6334df8a3fd66d13082606b69a78fa592237 Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Tue, 22 Sep 2020 15:26:08 -0700 Subject: Remove sigmoidgain, only allow one instance of grapher to run at a time --- grapher/Program.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'grapher/Program.cs') diff --git a/grapher/Program.cs b/grapher/Program.cs index 85fd040..485e074 100644 --- a/grapher/Program.cs +++ b/grapher/Program.cs @@ -11,9 +11,19 @@ namespace grapher [STAThread] static void Main() { + var mutex = new System.Threading.Mutex(true, "RawAccelGrapher", out bool result); + + if (!result) + { + MessageBox.Show("Another instance of the Raw Accel Grapher is already running."); + return; + } + Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new RawAcceleration()); + + GC.KeepAlive(mutex); } } } -- cgit v1.2.3