aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorItay Grudev <itay+github.com@grudev.com>2020-12-25 08:56:18 +0000
committerGitHub <noreply@github.com>2020-12-25 08:56:18 +0000
commite99b8df38f9e8bc7a9f6ce7b2a20db791c1e2bb3 (patch)
tree0957bf7bfcb7f71b5882d627e605960e440216c5
parentMerge pull request #124 from Shatur95/use-const-reference (diff)
parentUpdate singleapplication_p.cpp (diff)
downloadsingleapplication-e99b8df38f9e8bc7a9f6ce7b2a20db791c1e2bb3.tar.xz
Merge pull request #125 from dail8859/fix-123
Remove ConnectionInfo after socket is destroyed
-rw-r--r--singleapplication_p.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/singleapplication_p.cpp b/singleapplication_p.cpp
index 1ab58c2..e65bd95 100644
--- a/singleapplication_p.cpp
+++ b/singleapplication_p.cpp
@@ -328,10 +328,11 @@ void SingleApplicationPrivate::slotConnectionEstablished()
}
);
- QObject::connect(nextConnSocket, &QLocalSocket::disconnected,
+ QObject::connect(nextConnSocket, &QLocalSocket::disconnected, nextConnSocket, &QLocalSocket::deleteLater);
+
+ QObject::connect(nextConnSocket, &QLocalSocket::destroyed,
[nextConnSocket, this](){
connectionMap.remove(nextConnSocket);
- nextConnSocket->deleteLater();
}
);