Fixes lock file removal

This commit is contained in:
Alexander Bikadorov 2014-06-27 12:30:00 +02:00
parent 80009ea260
commit 3cdca632f9
2 changed files with 4 additions and 1 deletions

View File

@ -107,6 +107,7 @@ QtLocalPeer::QtLocalPeer(QObject* parent, const QString &appId)
+ QLatin1Char('/') + socketName
+ QLatin1String("-lockfile");
lockFile.setFileName(lockName);
lockFileCreated = !lockFile.exists();
lockFile.open(QIODevice::ReadWrite);
}
@ -212,5 +213,6 @@ void QtLocalPeer::receiveConnection()
QtLocalPeer::~QtLocalPeer ()
{
lockFile.remove();
if (lockFileCreated)
lockFile.remove();
}

View File

@ -81,4 +81,5 @@ protected:
private:
static const char* ack;
bool lockFileCreated;
};