mirror of
https://github.com/itay-grudev/SingleApplication.git
synced 2025-01-28 06:30:19 +08:00
Mitigated QSharedMemory initialization failures
Mitigated QSharedMemory initialization failures due to large amount of processes attempting to get hold of the shared memory block at the same time
This commit is contained in:
parent
3e83f5ce13
commit
be013eff5c
@ -55,6 +55,10 @@ SingleApplication::SingleApplication( int &argc, char *argv[], bool allowSeconda
|
||||
// block and QLocalServer
|
||||
d->genBlockServerName();
|
||||
|
||||
// To mitigate QSharedMemory issues with large amount of processes
|
||||
// attempting to attach at the same time
|
||||
d->randomSleep();
|
||||
|
||||
#ifdef Q_OS_UNIX
|
||||
// By explicitly attaching it and then deleting it we make sure that the
|
||||
// memory is deleted even after the process has crashed on Unix.
|
||||
|
Loading…
Reference in New Issue
Block a user