summaryrefslogtreecommitdiff
path: root/gtk/gtkclipboard.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2004-11-11 19:57:41 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2004-11-11 19:57:41 +0000
commit75eb3f9d2f71554657bcf9dfd22d57b9dbdb64f2 (patch)
tree352e911439a5a16070e0bcb4717c99317d3ff266 /gtk/gtkclipboard.c
parent41628edebb199222c1d3af95af04ec6f1a017b7a (diff)
downloadgtk+-75eb3f9d2f71554657bcf9dfd22d57b9dbdb64f2.tar.gz
Remove two more places where we were unconditionally setting "visible",
2004-11-11 Matthias Clasen <mclasen@redhat.com> * gtk/gtkuimanager.c (update_node): Remove two more places where we were unconditionally setting "visible", causing unnecessary notifications. * gtk/gtkclipboard.c (gtk_clipboard_get_for_display): (gtk_clipboard_get): Clarify the docs. (#156638, Torsten Schoenfeld) (gtk_clipboard_finalize): Warn if the clipboard is still in its displays clipboard list.
Diffstat (limited to 'gtk/gtkclipboard.c')
-rw-r--r--gtk/gtkclipboard.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/gtk/gtkclipboard.c b/gtk/gtkclipboard.c
index 6a23db7e83..150e801a25 100644
--- a/gtk/gtkclipboard.c
+++ b/gtk/gtkclipboard.c
@@ -194,13 +194,22 @@ gtk_clipboard_finalize (GObject *object)
{
GtkClipboard *clipboard;
GtkWidget *clipboard_widget;
+ GSList *clipboards;
clipboard = GTK_CLIPBOARD (object);
+ clipboards = g_object_get_data (G_OBJECT (clipboard->display), "gtk-clipboard-list");
+ if (g_slist_index (clipboards, clipboard) >= 0)
+ g_warning ("GtkClipboard prematurely finalized");
+
clipboard_widget = get_clipboard_widget (clipboard->display);
clipboard_unset (clipboard);
+ clipboards = g_object_get_data (G_OBJECT (clipboard->display), "gtk-clipboard-list");
+ clipboards = g_slist_remove (clipboards, clipboard);
+ g_object_set_data (G_OBJECT (clipboard->display), "gtk-clipboard-list", clipboards);
+
if (g_main_loop_is_running (clipboard->store_loop))
{
g_main_loop_quit (clipboard->store_loop);
@@ -227,10 +236,9 @@ clipboard_display_closed (GdkDisplay *display,
clipboards = g_object_get_data (G_OBJECT (display), "gtk-clipboard-list");
g_object_run_dispose (G_OBJECT (clipboard));
- g_object_unref (clipboard);
clipboards = g_slist_remove (clipboards, clipboard);
-
g_object_set_data (G_OBJECT (display), "gtk-clipboard-list", clipboards);
+ g_object_unref (clipboard);
}
/**
@@ -268,8 +276,9 @@ clipboard_display_closed (GdkDisplay *display,
* Return value: the appropriate clipboard object. If no
* clipboard already exists, a new one will
* be created. Once a clipboard object has
- * been created, it is persistent for all time and
- * cannot be freed.
+ * been created, it is persistent and, since
+ * it is owned by GTK+, must not be freed or
+ * unrefd.
*
* Since: 2.2
**/
@@ -295,8 +304,9 @@ gtk_clipboard_get_for_display (GdkDisplay *display,
* Return value: the appropriate clipboard object. If no
* clipboard already exists, a new one will
* be created. Once a clipboard object has
- * been created, it is persistent for all time and
- * cannot be freed.
+ * been created, it is persistent and, since
+ * it is owned by GTK+, must not be freed or
+ * unrefd.
**/
GtkClipboard *
gtk_clipboard_get (GdkAtom selection)