fix potential duplicate cleanup
This commit is contained in:
@@ -183,8 +183,10 @@ void Connection::run() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (m_socket) {
|
||||||
delete m_socket;
|
delete m_socket;
|
||||||
m_socket = nullptr;
|
m_socket = nullptr;
|
||||||
|
}
|
||||||
logInfo(lf_network, "[%05d] connection closed", getID());
|
logInfo(lf_network, "[%05d] connection closed", getID());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+6
-1
@@ -231,7 +231,12 @@ class Connection : public Thread {
|
|||||||
m_id = ++m_ids;
|
m_id = ++m_ids;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual ~Connection() { if (m_socket) delete m_socket; }
|
virtual ~Connection() {
|
||||||
|
if (m_socket) {
|
||||||
|
delete m_socket;
|
||||||
|
m_socket = nullptr;
|
||||||
|
}
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* endless loop for connection instance.
|
* endless loop for connection instance.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user