Index: /trunk/src/VBox/HostServices/GuestProperties/service.cpp
===================================================================
--- /trunk/src/VBox/HostServices/GuestProperties/service.cpp	(revision 75980)
+++ /trunk/src/VBox/HostServices/GuestProperties/service.cpp	(revision 75981)
@@ -353,17 +353,5 @@
     }
 
-    /**
-     * @interface_method_impl{VBOXHGCMSVCFNTABLE,pfnConnect}
-     * Stub implementation of pfnConnect and pfnDisconnect.
-     */
-    static DECLCALLBACK(int) svcDisconnect(void * /* pvService */,
-                                           uint32_t /* u32ClientID */,
-                                           void * /* pvClient */)
-    {
-        /** @todo r=bird: Here be dragons! You must complete all calls for the client as
-         * it disconnects or we'll end wasting space...  We're also confused after
-         * restoring state, but that's a bug somewhere in VMMDev, I think. */
-        return VINF_SUCCESS;
-    }
+    static DECLCALLBACK(int) svcDisconnect(void *pvService, uint32_t idClient, void *pvClient);
 
     /**
@@ -1606,4 +1594,33 @@
 
 /**
+ * @interface_method_impl{VBOXHGCMSVCFNTABLE,pfnDisconnect}
+ */
+/*static*/ DECLCALLBACK(int) Service::svcDisconnect(void *pvService, uint32_t idClient, void *pvClient)
+{
+    RT_NOREF(pvClient);
+    LogFlowFunc(("idClient=%u\n", idClient));
+    SELF *pThis = reinterpret_cast<SELF *>(pvService);
+    AssertLogRelReturn(pThis, VERR_INVALID_POINTER);
+
+    /*
+     * Complete all pending requests for this client.
+     */
+    for (CallList::iterator It = pThis->mGuestWaiters.begin(); It != pThis->mGuestWaiters.end();)
+    {
+        GuestCall &rCurCall = *It;
+        if (rCurCall.u32ClientId != idClient)
+            ++It;
+        else
+        {
+            LogFlowFunc(("Completing call %u (%p)...\n", rCurCall.mFunction, rCurCall.mHandle));
+            pThis->mpHelpers->pfnCallComplete(rCurCall.mHandle, VERR_INTERRUPTED);
+            It = pThis->mGuestWaiters.erase(It);
+        }
+    }
+
+    return VINF_SUCCESS;
+}
+
+/**
  * Increments a counter property.
  *
