changeset 19039:3054f7c6b30d

- Add logic to allow tls_peers manager to properly uninit itself when the certmgr is closed
author William Ehlhardt <williamehlhardt@gmail.com>
date Fri, 20 Jul 2007 08:39:00 +0000
parents 5040616cace9
children 4167e2d7ebef
files pidgin/gtkcertmgr.c
diffstat 1 files changed, 16 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/pidgin/gtkcertmgr.c	Thu Jul 19 08:56:21 2007 +0000
+++ b/pidgin/gtkcertmgr.c	Fri Jul 20 08:39:00 2007 +0000
@@ -42,12 +42,25 @@
 /*****************************************************************************
  * X.509 tls_peers management interface                                      *
  *****************************************************************************/
+
+static void
+tls_peers_mgmt_destroy(GtkWidget *mgmt_widget, gpointer data)
+{
+	purple_debug_info("certmgr",
+			  "tls peers self-destructs\n");
+}
+
 static GtkWidget *
 tls_peers_mgmt_build(void)
 {
-	GtkWidget *label = gtk_label_new("TLS PEEERSSSSS!!!");
-	gtk_widget_show(label);
-	return label;
+	GtkWidget *mgmt_widget = gtk_label_new("TLS PEEERSSSSS!!!");
+	gtk_widget_show(mgmt_widget);
+
+	/* Ensure that everything gets cleaned up when the dialog box
+	   is closed */
+	g_signal_connect(G_OBJECT(mgmt_widget), "destroy",
+			 G_CALLBACK(tls_peers_mgmt_destroy), NULL);
+	return mgmt_widget;
 }
 
 PidginCertificateManager tls_peers_mgmt = {