Index: /trunk/src/VBox/GuestHost/OpenGL/util/vboxhgcm.c
===================================================================
--- /trunk/src/VBox/GuestHost/OpenGL/util/vboxhgcm.c	(revision 15963)
+++ /trunk/src/VBox/GuestHost/OpenGL/util/vboxhgcm.c	(revision 15964)
@@ -906,9 +906,13 @@
     if (!g_crvboxhgcm.initialized) return;
 
-    /* Connection count would be changed while we disconnect link, also the array of connections would be shifted*/
+    /* Connection count would be changed in calls to crNetDisconnect, so we have to store original value.
+     * Walking array backwards is not a good idea as it could cause some issues if we'd disconnect clients not in the
+     * order of their connection.
+     */
     cCons = g_crvboxhgcm.num_conns;
     for (i=0; i<cCons; i++)
     {
-        crNetDisconnect(g_crvboxhgcm.conns[i]);
+        /* Note that [0] is intended, as the connections array would be shifted in each call to crNetDisconnect */
+        crNetDisconnect(g_crvboxhgcm.conns[0]);
     }
     CRASSERT(0==g_crvboxhgcm.num_conns);
