From fc5ce4c335a6b10b0fd0de1adc021d788cd3f34b Mon Sep 17 00:00:00 2001 From: Itay Grudev Date: Wed, 4 May 2016 17:36:32 +0100 Subject: Bug fix possible situation in which memory is detached --- singleapplication.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'singleapplication.cpp') diff --git a/singleapplication.cpp b/singleapplication.cpp index 34197f1..100ec9c 100644 --- a/singleapplication.cpp +++ b/singleapplication.cpp @@ -121,14 +121,11 @@ SingleApplication::SingleApplication(int &argc, char *argv[]) // might have crashed. // So only after a successful connection is the second instance // terminated. - if( d->socket->waitForConnected(100) ) - { - // Terminate the program using STDLib's exit function - ::exit(EXIT_SUCCESS); - } else { - delete d->memory; - ::exit(EXIT_SUCCESS); - } + d->socket->waitForConnected(100); + delete d->memory; + + // Terminate the program using STDLib's exit function + ::exit(EXIT_SUCCESS); } } -- cgit v1.2.1