Ensure the same behavior on Win as Unix re the host in isApparentlyStale

When the hostname is empty then it is assumed that the lock file is from
the same host as the one running the application.

Change-Id: Iba8aefc171a209294371dc2022d93ede3035b242
Reviewed-by: Will Wagner <willw@carallon.com>
Reviewed-by: David Faure <david.faure@kdab.com>
This commit is contained in:
Andy Shaw 2015-05-20 19:28:44 +02:00
parent 20e36879d7
commit e96ad10fd8

View File

@ -120,7 +120,7 @@ bool QLockFilePrivate::isApparentlyStale() const
// processes due to sandboxing
#ifndef Q_OS_WINRT
if (getLockInfo(&pid, &hostname, &appname)) {
if (hostname == QString::fromLocal8Bit(localHostName())) {
if (hostname.isEmpty() || hostname == QString::fromLocal8Bit(localHostName())) {
HANDLE procHandle = ::OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, pid);
if (!procHandle)
return true;