diff options
author | Itay Grudev <itay+github.com@grudev.com> | 2020-12-25 08:56:18 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-25 08:56:18 +0000 |
commit | e99b8df38f9e8bc7a9f6ce7b2a20db791c1e2bb3 (patch) | |
tree | 0957bf7bfcb7f71b5882d627e605960e440216c5 | |
parent | Merge pull request #124 from Shatur95/use-const-reference (diff) | |
parent | Update singleapplication_p.cpp (diff) | |
download | singleapplication-e99b8df38f9e8bc7a9f6ce7b2a20db791c1e2bb3.tar.xz |
Merge pull request #125 from dail8859/fix-123
Remove ConnectionInfo after socket is destroyed
-rw-r--r-- | singleapplication_p.cpp | 5 |
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(); } ); |