Browse Source

Remove the lockfile on exit (#14997)

adaptive-webui-19844
brvphoenix 4 years ago committed by GitHub
parent
commit
aebb9f89d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      src/app/qtlocalpeer/qtlocalpeer.cpp
  2. 1
      src/app/qtlocalpeer/qtlocalpeer.h

6
src/app/qtlocalpeer/qtlocalpeer.cpp

@ -134,6 +134,12 @@ QtLocalPeer::QtLocalPeer(QObject* parent, const QString &appId) @@ -134,6 +134,12 @@ QtLocalPeer::QtLocalPeer(QObject* parent, const QString &appId)
lockFile.open(QIODevice::ReadWrite);
}
QtLocalPeer::~QtLocalPeer()
{
lockFile.unlock();
lockFile.remove();
}
bool QtLocalPeer::isClient()
{
if (lockFile.isLocked())

1
src/app/qtlocalpeer/qtlocalpeer.h

@ -78,6 +78,7 @@ class QtLocalPeer : public QObject @@ -78,6 +78,7 @@ class QtLocalPeer : public QObject
public:
QtLocalPeer(QObject *parent = nullptr, const QString &appId = QString());
~QtLocalPeer() override;
bool isClient();
bool sendMessage(const QString &message, int timeout);

Loading…
Cancel
Save