mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-22 14:23:35 -07:00
Remove the lockfile on exit (#14997)
This commit is contained in:
parent
eff465126e
commit
baa32a20e0
2 changed files with 7 additions and 0 deletions
|
@ -133,6 +133,12 @@ QtLocalPeer::QtLocalPeer(QObject* parent, const QString &appId)
|
||||||
lockFile.open(QIODevice::ReadWrite);
|
lockFile.open(QIODevice::ReadWrite);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QtLocalPeer::~QtLocalPeer()
|
||||||
|
{
|
||||||
|
lockFile.unlock();
|
||||||
|
lockFile.remove();
|
||||||
|
}
|
||||||
|
|
||||||
bool QtLocalPeer::isClient()
|
bool QtLocalPeer::isClient()
|
||||||
{
|
{
|
||||||
if (lockFile.isLocked())
|
if (lockFile.isLocked())
|
||||||
|
|
|
@ -78,6 +78,7 @@ class QtLocalPeer : public QObject
|
||||||
|
|
||||||
public:
|
public:
|
||||||
QtLocalPeer(QObject *parent = nullptr, const QString &appId = QString());
|
QtLocalPeer(QObject *parent = nullptr, const QString &appId = QString());
|
||||||
|
~QtLocalPeer() override;
|
||||||
|
|
||||||
bool isClient();
|
bool isClient();
|
||||||
bool sendMessage(const QString &message, int timeout);
|
bool sendMessage(const QString &message, int timeout);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue