Remove lockfile only when last app instance is destroyed

This commit is contained in:
Vladimir Golovnev (Glassez) 2021-06-16 18:14:57 +03:00 committed by Vladimir Golovnev
parent e74ad86f14
commit 50ddfea617

View file

@ -96,7 +96,7 @@ namespace QtLP_Private
const char* QtLocalPeer::ack = "ack";
QtLocalPeer::QtLocalPeer(QObject* parent, const QString &appId)
QtLocalPeer::QtLocalPeer(QObject *parent, const QString &appId)
: QObject(parent)
, id(appId)
{
@ -136,8 +136,11 @@ QtLocalPeer::QtLocalPeer(QObject* parent, const QString &appId)
QtLocalPeer::~QtLocalPeer()
{
lockFile.unlock();
lockFile.remove();
if (!isClient())
{
lockFile.unlock();
lockFile.remove();
}
}
bool QtLocalPeer::isClient()