[Interest] Preventing Multiple Instances of EXE
Nye
kshegunov at gmail.com
Fri Apr 22 21:11:02 CEST 2016
Hello,
This is ordinarily done with the help of a global locking primitive (for
example a global mutex). On the first run the mutex would be locked, and if
locking fails on the second one, you just exit the application.
IMPORTANT: As any global resource, special care should be taken to release
it in case of expected or unexpected program shutdown.
As for a Qt-way of doing this, you could try QSystemSemaphore (
http://doc.qt.io/qt-5/qsystemsemaphore.html).
Kind regards.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20160422/5c7c6cb4/attachment.html>
More information about the Interest
mailing list