diff options
author | Matthias Clasen <mclasen@redhat.com> | 2008-10-25 23:12:03 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2008-10-25 23:12:03 +0000 |
commit | 2db879fe87f8bb0eb049b33d7a5b535b8ffa72dc (patch) | |
tree | 49229dd4e8b7c2c1014b1a343bbeb9e974118e11 | |
parent | c29237900c9537beffb7147971ef949650918718 (diff) | |
download | gtk+-2db879fe87f8bb0eb049b33d7a5b535b8ffa72dc.tar.gz |
Bug 557315 – stale clipboard target cache
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
svn path=/trunk/; revision=21713
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | gtk/gtkclipboard.c | 11 |
2 files changed, 17 insertions, 1 deletions
@@ -1,3 +1,10 @@ +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 + 2008-10-24 Tristan Van Berkom <tvb@gnome.org> * gtk/gtkwidget.c: Added a note about GtkWidget:has-tooltip in diff --git a/gtk/gtkclipboard.c b/gtk/gtkclipboard.c index a71e09dc03..48ee63f537 100644 --- a/gtk/gtkclipboard.c +++ b/gtk/gtkclipboard.c @@ -236,6 +236,7 @@ gtk_clipboard_finalize (GObject *object) 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 @@ gtk_clipboard_set_contents (GtkClipboard *clipboard, { 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 @@ gtk_clipboard_owner_change (GtkClipboard *clipboard, { 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; } } |