A single instance application that can restart itself
-
I used this:
"http://developer.nokia.com/community/wiki/Run_only_one_instance_of_a_Qt_application
":http://developer.nokia.com/community/wiki/Run_only_one_instance_of_a_Qt_application to implement a singleton application pattern for my application and this:
"http://qt-project.org/forums/viewthread/6293":http://qt-project.org/forums/viewthread/6293
to make the application restart itself.Or in short I use QLocalSocket to implement the single application instance functionality and:
@
QProcess::startDetached(QApplication::applicationFilePath());
exit(12);
@On my first run the this seems to work fine but I am concerned that eventually the new instance could run before the old instance was shutdown.
Is there a better way to do it or this is the only way?