diff options
-rw-r--r-- | singleapplication.cpp | 30 | ||||
-rw-r--r-- | singleapplication_p.h | 1 |
2 files changed, 13 insertions, 18 deletions
diff --git a/singleapplication.cpp b/singleapplication.cpp index bb50f49..34d9b1d 100644 --- a/singleapplication.cpp +++ b/singleapplication.cpp @@ -47,7 +47,19 @@ SingleApplicationPrivate::SingleApplicationPrivate( SingleApplication *q_ptr ) : SingleApplicationPrivate::~SingleApplicationPrivate() { - cleanUp(); + if( socket != nullptr ) { + socket->close(); + delete socket; + } + memory->lock(); + InstancesInfo* inst = (InstancesInfo*)memory->data(); + if( server != nullptr ) { + server->close(); + delete server; + inst->primary = false; + } + memory->unlock(); + delete memory; } void SingleApplicationPrivate::genBlockServerName( int timeout ) @@ -230,22 +242,6 @@ void SingleApplicationPrivate::connectToPrimary( int msecs, char connectionType QMutex SingleApplicationPrivate::sharedMemMutex; #endif -void SingleApplicationPrivate::cleanUp() { - if( socket != nullptr ) { - socket->close(); - delete socket; - } - memory->lock(); - InstancesInfo* inst = (InstancesInfo*)memory->data(); - if( server != nullptr ) { - server->close(); - delete server; - inst->primary = false; - } - memory->unlock(); - delete memory; -} - /** * @brief Executed when a connection has been made to the LocalServer */ diff --git a/singleapplication_p.h b/singleapplication_p.h index 661fe9e..266cbea 100644 --- a/singleapplication_p.h +++ b/singleapplication_p.h @@ -55,7 +55,6 @@ public: void startPrimary( bool resetMemory ); void startSecondary(); void connectToPrimary( int msecs, char connectionType ); - void cleanUp(); #ifdef Q_OS_UNIX void crashHandler(); |