PSVRFramework
PSVRFramework copied to clipboard
Singleton Implementation
It is just a small issue, but you can start the application 2 times and then it does not work correctly anymore!
How about implementation of a Singleton, that checks if Prog is already started
something like that
static class Program { static Mutex mutex = new Mutex(true, "PSVRToolbox"); [STAThread] static void Main() { if(mutex.WaitOne(TimeSpan.Zero, true)) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Form1()); mutex.ReleaseMutex(); } else { MessageBox.Show("only one instance at a time"); } } }
https://github.com/wildwing1970/PSVRFramework/commit/3cc8b5462160cc39e924069de3a8356e02796951
I will use the same mutex in my QT Project ...... so that the programs do not interfere, when running