From 163fbe1dcd9fc538810041569efc25a444d7cc25 Mon Sep 17 00:00:00 2001 From: wmayer Date: Sat, 25 May 2013 01:45:37 +0200 Subject: [PATCH] Fix lock file issue on Linux --- src/Gui/Application.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Gui/Application.cpp b/src/Gui/Application.cpp index 915de9b8d..f93d3550b 100644 --- a/src/Gui/Application.cpp +++ b/src/Gui/Application.cpp @@ -1795,7 +1795,9 @@ void Application::checkForPreviousCrashes() QList locks = tmp.entryInfoList(); for (QList::iterator it = locks.begin(); it != locks.end(); ++it) { QString bn = it->baseName(); - if (bn.startsWith(exeName)) { + // ignore the lock file for this instance + QString pid = QString::number(QCoreApplication::applicationPid()); + if (bn.startsWith(exeName) && bn.indexOf(pid) < 0) { QString fn = it->absoluteFilePath(); boost::interprocess::file_lock flock((const char*)fn.toLocal8Bit()); if (flock.try_lock()) {