From 41eb2c349994a372de6862e0a31fa7ba57f13d55 Mon Sep 17 00:00:00 2001 From: Itay Grudev Date: Thu, 7 May 2015 15:29:06 +0100 Subject: Fixed memory leak As described in issue #2 each new socket is not deallocated and creates a memory leak --- singleapplication.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'singleapplication.cpp') 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(); } -- cgit v1.2.1