diff --git a/singleapplication_p.cpp b/singleapplication_p.cpp index 1ab58c2..70edaae 100644 --- a/singleapplication_p.cpp +++ b/singleapplication_p.cpp @@ -328,10 +328,12 @@ void SingleApplicationPrivate::slotConnectionEstablished() } ); - QObject::connect(nextConnSocket, &QLocalSocket::disconnected, - [nextConnSocket, this](){ + QObject::connect(nextConnSocket, &QLocalSocket::disconnected, nextConnSocket, &QLocalSocket::deleteLater); + + QObject::connect(nextConnSocket, &QLocalSocket::destroyed, + [nextConnSocket, this](QObject *obj){ + Q_UNUSED(obj) connectionMap.remove(nextConnSocket); - nextConnSocket->deleteLater(); } );