pidgin/ljfisher-ssl-client-auth

Cleanly handle webkit destroy events.
soc.2009.webkitmessageview
2009-08-10, Arnold Noronha
04857274f841
Parents 184f94216441
Children 5771be5530d8
Cleanly handle webkit destroy events.
--- 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;