diff --git a/libnx/nxmu/nx_connect.c b/libnx/nxmu/nx_connect.c index 00b93934e3..e69580bce8 100644 --- a/libnx/nxmu/nx_connect.c +++ b/libnx/nxmu/nx_connect.c @@ -60,8 +60,8 @@ ****************************************************************************/ /* Each client is assigned a unique ID using the g_nxcid counter. That - * counter increments as each new counter is created and is* protected for - * thread safefy with g_nxlibsem. Note that these are the only global values + * counter increments as each new counter is created and is protected for + * thread safety with g_nxlibsem. Note that these are the only global values * in the NX implementation. This is because the client ID must be unique * even across all server instances. * diff --git a/libnx/nxmu/nx_disconnect.c b/libnx/nxmu/nx_disconnect.c index d8cd4517e2..6b1877efc3 100644 --- a/libnx/nxmu/nx_disconnect.c +++ b/libnx/nxmu/nx_disconnect.c @@ -39,6 +39,7 @@ #include +#include #include #include #include @@ -70,6 +71,7 @@ void nx_disconnect(NXHANDLE handle) { FAR struct nxfe_conn_s *conn = (FAR struct nxfe_conn_s *)handle; struct nxsvrmsg_s outmsg; + char climqname[NX_CLIENT_MXNAMELEN]; int ret; /* Inform the server that this client no longer exists */ @@ -84,4 +86,10 @@ void nx_disconnect(NXHANDLE handle) { gerr("ERROR: nxmu_sendserver() returned %d\n", ret); } + else + { + snprintf(climqname, sizeof(climqname), + NX_CLIENT_MQNAMEFMT, conn->cid); + (void)mq_unlink(climqname); + } }