1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-02-02 09:55:55 +00:00

Remove the lockfile on exit (#14997)

This commit is contained in:
brvphoenix 2021-05-23 14:29:41 +08:00 committed by GitHub
parent 40f6201509
commit aebb9f89d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 0 deletions

View File

@ -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())

View File

@ -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);