Index: trunk/src/VBox/Main/src-client/GuestCtrlImpl.cpp
===================================================================
--- trunk/src/VBox/Main/src-client/GuestCtrlImpl.cpp	(revision 93164)
+++ trunk/src/VBox/Main/src-client/GuestCtrlImpl.cpp	(revision 93166)
@@ -240,43 +240,4 @@
 
 /**
- * Removes a guest control session from the internal list and destroys the session.
- *
- * @returns VBox status code.
- * @param   uSessionID          ID of the guest control session to remove.
- */
-int Guest::i_sessionRemove(uint32_t uSessionID)
-{
-    LogFlowThisFuncEnter();
-
-    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
-
-    int rc = VERR_NOT_FOUND;
-
-    LogFlowThisFunc(("Removing session (ID=%RU32) ...\n", uSessionID));
-
-    GuestSessions::iterator itSessions = mData.mGuestSessions.find(uSessionID);
-    if (itSessions == mData.mGuestSessions.end())
-        return VERR_NOT_FOUND;
-
-    /* Make sure to consume the pointer before the one of the
-     * iterator gets released. */
-    ComObjPtr<GuestSession> pSession = itSessions->second;
-
-    LogFlowThisFunc(("Removing session %RU32 (now total %ld sessions)\n",
-                     uSessionID, mData.mGuestSessions.size() ? mData.mGuestSessions.size() - 1 : 0));
-
-    rc = pSession->i_onRemove();
-    mData.mGuestSessions.erase(itSessions);
-
-    alock.release(); /* Release lock before firing off event. */
-
-    ::FireGuestSessionRegisteredEvent(mEventSource, pSession, false /* Unregistered */);
-    pSession.setNull();
-
-    LogFlowFuncLeaveRC(rc);
-    return rc;
-}
-
-/**
  * Creates a new guest session.
  * This will invoke VBoxService running on the guest creating a new (dedicated) guest session
@@ -289,4 +250,6 @@
  *                              The specified user must be able to logon to the guest and able to start new processes.
  * @param   pGuestSession       Where to store the created guest session on success.
+ *
+ * @note    Takes the write lock.
  */
 int Guest::i_sessionCreate(const GuestSessionStartupInfo &ssInfo,
@@ -371,8 +334,51 @@
 
 /**
+ * Destroys a given guest session and removes it from the internal list.
+ *
+ * @returns VBox status code.
+ * @param   uSessionID          ID of the guest control session to destroy.
+ *
+ * @note    Takes the write lock.
+ */
+int Guest::i_sessionDestroy(uint32_t uSessionID)
+{
+    LogFlowThisFuncEnter();
+
+    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
+
+    int rc = VERR_NOT_FOUND;
+
+    LogFlowThisFunc(("Destroying session (ID=%RU32) ...\n", uSessionID));
+
+    GuestSessions::iterator itSessions = mData.mGuestSessions.find(uSessionID);
+    if (itSessions == mData.mGuestSessions.end())
+        return VERR_NOT_FOUND;
+
+    /* Make sure to consume the pointer before the one of the
+     * iterator gets released. */
+    ComObjPtr<GuestSession> pSession = itSessions->second;
+
+    LogFlowThisFunc(("Removing session %RU32 (now total %ld sessions)\n",
+                     uSessionID, mData.mGuestSessions.size() ? mData.mGuestSessions.size() - 1 : 0));
+
+    rc = pSession->i_onRemove();
+    mData.mGuestSessions.erase(itSessions);
+
+    alock.release(); /* Release lock before firing off event. */
+
+    ::FireGuestSessionRegisteredEvent(mEventSource, pSession, false /* Unregistered */);
+    pSession.setNull();
+
+    LogFlowFuncLeaveRC(rc);
+    return rc;
+}
+
+/**
  * Returns whether a guest control session with a specific ID exists or not.
  *
  * @returns Returns \c true if the session exists, \c false if not.
  * @param   uSessionID          ID to check for.
+ *
+ * @note    No locking done, as inline function!
  */
 inline bool Guest::i_sessionExists(uint32_t uSessionID)
Index: trunk/src/VBox/Main/src-client/GuestSessionImpl.cpp
===================================================================
--- trunk/src/VBox/Main/src-client/GuestSessionImpl.cpp	(revision 93164)
+++ trunk/src/VBox/Main/src-client/GuestSessionImpl.cpp	(revision 93166)
@@ -3324,7 +3324,7 @@
      * work first and then return an error. */
 
-    /* Remove ourselves from the session list. */
+    /* Destroy session + remove ourselves from the session list. */
     AssertPtr(mParent);
-    int vrc2 = mParent->i_sessionRemove(mData.mSession.mID);
+    int vrc2 = mParent->i_sessionDestroy(mData.mSession.mID);
     if (vrc2 == VERR_NOT_FOUND) /* Not finding the session anymore isn't critical. */
         vrc2 = VINF_SUCCESS;
