Check for an existing QWebSocketServer before creating a new one.
Leave an already-listening server untouched and clean up an existing
non-listening server before replacing it.
This resolves the cppcheck possible leak warning caused by overwriting
m_webSocketServer without deallocating the previous object.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Only log the disconnected client after confirming the socket pointer is
valid. This avoids passing a null pointer to getWebSocketIdentifier() when
socketDisconnected() is invoked without a valid client sender.
Found by cppcheck.
Signed-off-by: Robin Getz <rgetz503@gmail.com>