[gtk+] clipboard: remove dead code



commit d98b4fd0b433d56f7b2148f617baf212014a3b3e
Author: Aleksander Morgado <aleksander lanedo com>
Date:   Fri Mar 1 11:54:09 2013 +0100

    clipboard: remove dead code
    
    When setting contents of the clipboard and ownership or user data changes, we
    end up calling clipboard_unset() to fully cleanup the previous clipboard state.
    This call will itself call clear_func() for the previous user_data, and always
    reset both 'get_func' and 'clear_func' to NULL.
    
    So it's actually not possible to have 'get_func' being non-NULL once we have
    called clipboard_unset(), so just remove that condition check and the code
    inside.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=694924

 gtk/gtkclipboard.c |   26 ++++----------------------
 1 files changed, 4 insertions(+), 22 deletions(-)
---
diff --git a/gtk/gtkclipboard.c b/gtk/gtkclipboard.c
index e0b736f..cbc497a 100644
--- a/gtk/gtkclipboard.c
+++ b/gtk/gtkclipboard.c
@@ -614,28 +614,10 @@ gtk_clipboard_set_contents (GtkClipboard         *clipboard,
        {
          clipboard_unset (clipboard);
 
-         if (clipboard->get_func)
-           {
-             /* Calling unset() caused the clipboard contents to be reset!
-              * Avoid leaking and return 
-              */
-             if (!(clipboard->have_owner && have_owner) ||
-                 clipboard->user_data != user_data)
-               {
-                 (*clear_func) (clipboard, user_data);
-                 return FALSE;
-               }
-             else
-               return TRUE;
-           }
-         else
-           {
-             clipboard->user_data = user_data;
-             clipboard->have_owner = have_owner;
-             if (have_owner)
-               clipboard_add_owner_notify (clipboard);
-           }
-         
+         clipboard->user_data = user_data;
+         clipboard->have_owner = have_owner;
+         if (have_owner)
+             clipboard_add_owner_notify (clipboard);
        }
 
       clipboard->get_func = get_func;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]