Fixes lock file removal
This commit is contained in:
parent
80009ea260
commit
3cdca632f9
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -81,4 +81,5 @@ protected:
|
|||
|
||||
private:
|
||||
static const char* ack;
|
||||
bool lockFileCreated;
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue