aboutsummaryrefslogtreecommitdiff
path: root/singleapplication.cpp
diff options
context:
space:
mode:
authorItay Grudev <itay.grudev@gmail.com>2015-05-07 15:29:06 +0100
committerItay Grudev <itay.grudev@gmail.com>2015-05-07 15:29:06 +0100
commit41eb2c349994a372de6862e0a31fa7ba57f13d55 (patch)
tree7fdf3a2f268178a679383bc6e9033abe8f220f73 /singleapplication.cpp
parentBugfix: SingleApplication passing a copy of argc instead of reference (diff)
downloadsingleapplication-41eb2c349994a372de6862e0a31fa7ba57f13d55.tar.xz
Fixed memory leak
As described in issue #2 each new socket is not deallocated and creates a memory leak
Diffstat (limited to 'singleapplication.cpp')
-rw-r--r--singleapplication.cpp4
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();
}