Commit 88fa6935 authored by Matthias Clasen's avatar Matthias Clasen

Make finalizer more robust

svn path=/trunk/; revision=19283
parent 2227e299
2007-12-28 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkclipboard.c: Make the finalizer work when display is
not set.
2007-12-28 Mathias Hasselmann <mathias@openismus.com>
Draw bottom shadow of GtkCalender headings. (#506113)
......
......@@ -193,26 +193,31 @@ static void
gtk_clipboard_finalize (GObject *object)
{
GtkClipboard *clipboard;
GtkWidget *clipboard_widget;
GSList *clipboards;
GtkWidget *clipboard_widget = NULL;
GSList *clipboards = NULL;
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");
if (clipboard->display)
{
clipboards = g_object_get_data (G_OBJECT (clipboard->display), "gtk-clipboard-list");
if (g_slist_index (clipboards, clipboard) >= 0)
g_warning ("GtkClipboard prematurely finalized");
/* don't use get_clipboard_widget() here because it would create the
* widget if it doesn't exist.
*/
clipboard_widget = g_object_get_data (G_OBJECT (clipboard->display),
"gtk-clipboard-widget");
clipboards = g_slist_remove (clipboards, clipboard);
g_object_set_data (G_OBJECT (clipboard->display), "gtk-clipboard-list",
clipboards);
/* don't use get_clipboard_widget() here because it would create the
* widget if it doesn't exist.
*/
clipboard_widget = g_object_get_data (G_OBJECT (clipboard->display),
"gtk-clipboard-widget");
}
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), I_("gtk-clipboard-list"), clipboards);
if (clipboard->store_loop && g_main_loop_is_running (clipboard->store_loop))
g_main_loop_quit (clipboard->store_loop);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment