I have an app where I use a mutex to prevent another instance of the app from running. I create the mutex just like the example in the doc shows, but I do not kill it as shown in the docs.
This has been working fine for several years. Now, I have one user reporting that he can't start the app because he is getting the error message I display when the mutex cannot be created. He is running Windows 10. I tested the app in Windows 10 and I'm not getting this message unless I actually try to run a duplicate instance.
I tried creating a small app for this user that would execute an mutex.leave using the same name as the one in my app, but then he gets the error message saying that the thread which Signaled the Mutex must be the thread to Release the Mutex. Of course, this makes sense. I also had him reboot the computer. He reports the the task manager confirms there is no program with the name of my app running when he gets the error.
My question is, how can this happen? In searching the forums, I see I'm not the only one to rely on the app quitting to nil the mutex. What can be done to correct the problem?