diff --git a/viewer/svutil.cpp b/viewer/svutil.cpp index c41bf04093..80e11019e5 100644 --- a/viewer/svutil.cpp +++ b/viewer/svutil.cpp @@ -422,6 +422,7 @@ SVNetwork::SVNetwork(const char* hostname, int port) { // Wait for server to show up. // Note: There is no exception handling in case the server never turns up. + Close(); stream_ = socket(addr_info->ai_family, addr_info->ai_socktype, addr_info->ai_protocol); @@ -434,6 +435,7 @@ SVNetwork::SVNetwork(const char* hostname, int port) { sleep(1); #endif + Close(); stream_ = socket(addr_info->ai_family, addr_info->ai_socktype, addr_info->ai_protocol); }