Fix a race condition on startup that might lead to two instances of Clementine being started.

This commit is contained in:
David Sansome 2010-12-25 17:49:04 +00:00
parent ae9ada254c
commit e6561a0122
1 changed files with 5 additions and 1 deletions

View File

@ -217,7 +217,11 @@ int main(int argc, char *argv[]) {
#endif
a.setQuitOnLastWindowClosed(false);
a.isRunning(); // Otherwise QtLocalPeer won't lock the lockfile :S
// Do this check again because another instance might have started by now
if (a.isRunning() && a.sendMessage(options.Serialize(), 5000)) {
return 0;
}
#ifndef Q_OS_DARWIN
// Gnome on Ubuntu has menu icons disabled by default. I think that's a bad