Solved Clear QSharedMemory after crash
-
Re: QT single instance application
Hello, I'm trying to implement a SingleInstance Solution for my application and have used the solution mentioned in the above topic (solution proposed by @SGaist ). Works fine as long as we don't run into any crash. In case of a crash, the destructor is not called and an entry is left in the SharedMemory causing the first started instance after a crash to think that there is already a running instance.
Is there a way to mitigate this issue? I'm working on a cross platform application so I'm looking for a solution that would work on Windows, Linux and MacOS
-
@dporobic
I have not looked at the code you are using from singleton instance, but you might read the accepted solution to https://stackoverflow.com/questions/42549904/qsharedmemory-is-not-getting-deleted-on-application-crash. -
@dporobic
I have not looked at the code you are using from singleton instance, but you might read the accepted solution to https://stackoverflow.com/questions/42549904/qsharedmemory-is-not-getting-deleted-on-application-crash. -
@JonB Thanks, will give it a try later today.
-