Skip to content

Commit

Permalink
Remove lockfile only when last app instance is destroyed
Browse files Browse the repository at this point in the history
  • Loading branch information
glassez committed Jun 18, 2021
1 parent e74ad86 commit 50ddfea
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/app/qtlocalpeer/qtlocalpeer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 50ddfea

Please sign in to comment.