# HG changeset patch # User tdrhq@soc.pidgin.im # Date 1249883768 0 # Node ID 7b92a2b852db9c9121dbb66517f514cf978e8f28 # Parent 7194ddfc8158626768f404796698b4c160b4c3f2 Cleanly handle webkit destroy events. diff -r 7194ddfc8158 -r 7b92a2b852db pidgin/plugins/adiumthemes/webkit.c --- a/pidgin/plugins/adiumthemes/webkit.c Mon Aug 10 05:36:10 2009 +0000 +++ b/pidgin/plugins/adiumthemes/webkit.c Mon Aug 10 05:56:08 2009 +0000 @@ -122,6 +122,7 @@ } static void variant_set_default (PidginMessageStyle* style); +static void webkit_on_webview_destroy (GtkObject* obj, gpointer data); static PidginMessageStyle* pidgin_message_style_load (const char* styledir) @@ -462,6 +463,8 @@ g_object_set_data (G_OBJECT(webkit), MESSAGE_STYLE_KEY, style); + /* I need to unref this style when the webkit object destroys */ + g_signal_connect (G_OBJECT(webkit), "destroy", G_CALLBACK(webkit_on_webview_destroy), style); g_free (basedir); g_free (baseuri); @@ -484,6 +487,13 @@ pidgin_message_style_unref (style); } +static void +webkit_on_webview_destroy (GtkObject *object, gpointer data) +{ + pidgin_message_style_unref ((PidginMessageStyle*) data); + g_object_set_data (G_OBJECT(object), MESSAGE_STYLE_KEY, NULL); +} + struct webkit_script { GtkWidget *webkit; char *script;