diff --git a/source/vibe/core/net.d b/source/vibe/core/net.d index b1d7f34..8eb1bb1 100644 --- a/source/vibe/core/net.d +++ b/source/vibe/core/net.d @@ -218,8 +218,10 @@ TCPConnection connectTCP(NetworkAddress addr, NetworkAddress bind_address = anyA ": timeout"); if (status != ConnectStatus.connected) { - if (sock != SocketFD.invalid) - assert(!eventDriver.sockets.releaseRef(sock)); + if (sock != SocketFD.invalid) { + bool refsLeft = eventDriver.sockets.releaseRef(sock); + assert(!refsLeft); + } enforce(false, "Failed to connect to "~addr.toString()~": "~status.to!string); assert(false);