diff --git a/src/unix/gsocket.c b/src/unix/gsocket.c index 65e16aa68c..53834426de 100644 --- a/src/unix/gsocket.c +++ b/src/unix/gsocket.c @@ -165,13 +165,13 @@ void GSocket_destroy(GSocket *socket) { assert(socket != NULL); - /* Per-socket GUI-specific cleanup */ - _GSocket_GUI_Destroy(socket); - /* Check that the socket is really shutdowned */ if (socket->m_fd != -1) GSocket_Shutdown(socket); + /* Per-socket GUI-specific cleanup */ + _GSocket_GUI_Destroy(socket); + /* Destroy private addresses */ if (socket->m_local) GAddress_destroy(socket->m_local);