diff options
author | Itay Grudev <itay.grudev@gmail.com> | 2015-05-07 15:29:06 +0100 |
---|---|---|
committer | Itay Grudev <itay.grudev@gmail.com> | 2015-05-07 15:29:06 +0100 |
commit | 41eb2c349994a372de6862e0a31fa7ba57f13d55 (patch) | |
tree | 7fdf3a2f268178a679383bc6e9033abe8f220f73 | |
parent | Bugfix: SingleApplication passing a copy of argc instead of reference (diff) | |
download | singleapplication-41eb2c349994a372de6862e0a31fa7ba57f13d55.tar.xz |
Fixed memory leak
As described in issue #2 each new socket is not deallocated and creates a memory leak
-rw-r--r-- | singleapplication.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/singleapplication.cpp b/singleapplication.cpp index 516e6ed..4858f96 100644 --- a/singleapplication.cpp +++ b/singleapplication.cpp @@ -42,6 +42,8 @@ SingleApplication::~SingleApplication() */ void SingleApplication::slotConnectionEstablished() { - server->nextPendingConnection(); + QLocalSocket *socket = server->nextPendingConnection(); + socket->close(); + delete socket; emit showUp(); } |