gtk+ r21713 - in trunk: . gtk



Author: matthiasc
Date: Sat Oct 25 23:12:03 2008
New Revision: 21713
URL: http://svn.gnome.org/viewvc/gtk+?rev=21713&view=rev

Log:
2008-10-25  Matthias Clasen  <mclasen redhat com>

        Bug 557315 â stale clipboard target cache

        * gtk/gtkclipboard.c (gtk_clipboard_set_contents): Remove cached
        targets. Pointed out by Evan Stade



Modified:
   trunk/ChangeLog
   trunk/gtk/gtkclipboard.c

Modified: trunk/gtk/gtkclipboard.c
==============================================================================
--- trunk/gtk/gtkclipboard.c	(original)
+++ trunk/gtk/gtkclipboard.c	Sat Oct 25 23:12:03 2008
@@ -236,6 +236,7 @@
     g_signal_handler_disconnect (clipboard_widget, clipboard->notify_signal_id);
   
   g_free (clipboard->storable_targets);
+  g_free (clipboard->cached_targets);
 
   G_OBJECT_CLASS (gtk_clipboard_parent_class)->finalize (object);
 }
@@ -514,6 +515,13 @@
     {
       clipboard->have_selection = TRUE;
 
+      if (clipboard->n_cached_targets != -1)
+        {
+          g_free (clipboard->cached_targets);
+	  clipboard->cached_targets = NULL;
+          clipboard->n_cached_targets = -1;
+        }
+
       if (!(clipboard->have_owner && have_owner) ||
 	  clipboard->user_data != user_data)
 	{
@@ -1840,8 +1848,9 @@
 {
   if (clipboard->n_cached_targets != -1)
     {
-      clipboard->n_cached_targets = -1;
       g_free (clipboard->cached_targets);
+      clipboard->cached_targets = NULL;
+      clipboard->n_cached_targets = -1;
     }
 }
 



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