607011 / Qt-SESAM

c't SESAM Password Manager (Qt version)
http://607011.github.io/Qt-SESAM/
GNU General Public License v3.0
77 stars 29 forks source link

Ensure that only one instance of Qt-SESAM is running … #72

Closed 607011 closed 9 years ago

607011 commented 9 years ago

… to avoid concurrency problems when one instance is overwriting saved data of another instance.

607011 commented 9 years ago

Resolved by commit 843f67a8a24b3311311fb9f65e5b2e7de7ed6dba.

607011 commented 9 years ago

An excerpt of the Qt docs, just as a reminder:

Windows: QSharedMemory does not "own" the shared memory segment. When all threads or processes that have an instance of QSharedMemory attached to a particular shared memory segment have either destroyed their instance of QSharedMemory or exited, the Windows kernel releases the shared memory segment automatically.

Unix: QSharedMemory "owns" the shared memory segment. When the last thread or process that has an instance of QSharedMemory attached to a particular shared memory segment detaches from the segment by destroying its instance of QSharedMemory, the Unix kernel release the shared memory segment. But if that last thread or process crashes without running the QSharedMemory destructor, the shared memory segment survives the crash.