]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Unregister legacy backdoor in X11 UI class destructor.
authorVMware, Inc <>
Mon, 20 Sep 2010 18:03:29 +0000 (11:03 -0700)
committerMarcelo Vanzin <mvanzin@vmware.com>
Mon, 20 Sep 2010 18:03:29 +0000 (11:03 -0700)
The legacy backdoor copy paste (used by ESX) is registered in
an Init function of the X11 UI class. We should only unregister
the legacy copy paste when this class is destructed.

Up to now, were were doing it as a side effect of resetting
dndcp version 3 and higher in response to a reset signal from
the plugin framework. This would cause the backdoor copypaste
code to unregister at reset without being registered once again
because the registration only happened in Init.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
open-vm-tools/services/plugins/dndcp/copyPasteDnDX11.cpp

index e393d5c336af63c9671602ac1ad4a3ef8a908089..c36ffe4bb06a0a19b02e18b3a4260695f9002d79 100644 (file)
@@ -80,7 +80,7 @@ CopyPasteDnDX11::CopyPasteDnDX11() :
 
 /**
  *
- * Initialize Win32 platform DnD/CP. Initialize OLE, and create detection
+ * Initialize Win32 platform DnD/CP. Initialize Gtk+, and create detection
  * windows.
  *
  * @param[in] ctx tools app context.
@@ -133,6 +133,12 @@ CopyPasteDnDX11::~CopyPasteDnDX11()
    if (m_main) {
       delete m_main;
    }
+
+   /*
+    * Legacy CP.
+    */
+   CopyPaste_Unregister(gUserMainWidget);
+
    if (gUserMainWidget) {
       gtk_widget_destroy(gUserMainWidget);
    }
@@ -249,11 +255,6 @@ CopyPasteDnDX11::UnregisterCP()
          delete m_copyPasteUI;
          m_copyPasteUI = NULL;
       }
-
-      /*
-       * Legacy CP.
-       */
-      CopyPaste_Unregister(gUserMainWidget);
       wrapper->SetCPIsRegistered(FALSE);
       wrapper->SetCPVersion(-1);
    }