Index: /trunk/src/VBox/Additions/x11/VBoxClient/clipboard.cpp
===================================================================
--- /trunk/src/VBox/Additions/x11/VBoxClient/clipboard.cpp	(revision 82314)
+++ /trunk/src/VBox/Additions/x11/VBoxClient/clipboard.cpp	(revision 82315)
@@ -246,8 +246,4 @@
         {
             rc = VbglR3ClipboardConnectEx(&g_Ctx.CmdCtx);
-#ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS
-            if (RT_SUCCESS(rc))
-                rc = ShClTransferCtxInit(&g_Ctx.TransferCtx);
-#endif
             if (RT_FAILURE(rc))
                 ShClX11ThreadStop(&g_Ctx.X11);
@@ -517,4 +513,20 @@
 }
 
+static int init(struct VBCLSERVICE **pSelf)
+{
+    RT_NOREF(pSelf);
+
+    int rc;
+
+#ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS
+    rc = ShClTransferCtxInit(&g_Ctx.TransferCtx);
+#else
+    rc = VINF_SUCCESS;
+#endif
+
+    LogFlowFuncLeaveRC(rc);
+    return rc;
+}
+
 static int run(struct VBCLSERVICE **ppInterface, bool fDaemonised)
 {
@@ -556,6 +568,4 @@
     ShClTransferCtxDestroy(&g_Ctx.TransferCtx);
 #endif
-
-    VbglR3Term();
 }
 
@@ -564,5 +574,5 @@
     getName,
     getPidFilePath,
-    VBClServiceDefaultHandler, /* init */
+    init,
     run,
     cleanup
