mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-23 04:54:18 +00:00
Remove lockfile only when last app instance is destroyed
This commit is contained in:
parent
e74ad86f14
commit
50ddfea617
@ -96,7 +96,7 @@ namespace QtLP_Private
|
|||||||
|
|
||||||
const char* QtLocalPeer::ack = "ack";
|
const char* QtLocalPeer::ack = "ack";
|
||||||
|
|
||||||
QtLocalPeer::QtLocalPeer(QObject* parent, const QString &appId)
|
QtLocalPeer::QtLocalPeer(QObject *parent, const QString &appId)
|
||||||
: QObject(parent)
|
: QObject(parent)
|
||||||
, id(appId)
|
, id(appId)
|
||||||
{
|
{
|
||||||
@ -136,8 +136,11 @@ QtLocalPeer::QtLocalPeer(QObject* parent, const QString &appId)
|
|||||||
|
|
||||||
QtLocalPeer::~QtLocalPeer()
|
QtLocalPeer::~QtLocalPeer()
|
||||||
{
|
{
|
||||||
|
if (!isClient())
|
||||||
|
{
|
||||||
lockFile.unlock();
|
lockFile.unlock();
|
||||||
lockFile.remove();
|
lockFile.remove();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QtLocalPeer::isClient()
|
bool QtLocalPeer::isClient()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user