X-Git-Url: http://git.maemo.org/git/?a=blobdiff_plain;f=src%2Fgnome%2Fmodest-store-widget.c;h=e1b738b67eae81880aadd67f9be6d3c78bb369b8;hb=27264ef758d4f7c95f17ff30f056ab7cacb0c0f6;hp=27918d2c65409eddae8a78f85d02f581986e11fc;hpb=1807d0ffbcc503686889d878c8a37b5c31f30b23;p=modest diff --git a/src/gnome/modest-store-widget.c b/src/gnome/modest-store-widget.c index 27918d2..e1b738b 100644 --- a/src/gnome/modest-store-widget.c +++ b/src/gnome/modest-store-widget.c @@ -48,8 +48,13 @@ struct _ModestStoreWidgetPrivate { GtkWidget *servername; GtkWidget *username; + + ModestPairList *security_protos; GtkWidget *security; + + ModestPairList *auth_protos; GtkWidget *auth; + GtkWidget *chooser; ModestTransportStoreProtocol proto; @@ -195,7 +200,6 @@ on_entry_changed (GtkEntry *entry, gpointer user_data) static GtkWidget* imap_pop_configuration (ModestStoreWidget *self) { - ModestPairList *protos; ModestStoreWidgetPrivate *priv; GtkWidget *label, *box, *hbox; @@ -226,9 +230,12 @@ imap_pop_configuration (ModestStoreWidget *self) gtk_label_set_markup (GTK_LABEL(label),_("Security")); gtk_box_pack_start (GTK_BOX(box), label, FALSE, FALSE, 0); - protos = modest_protocol_info_get_connection_protocol_pair_list (); - priv->security = modest_combo_box_new (protos, g_str_equal); - modest_pair_list_free (protos); + /* Note: This ModestPairList* must exist for as long as the combo + * that uses it, because the ModestComboBox uses the ID opaquely, + * so it can't know how to manage its memory. */ + priv->security_protos = modest_protocol_info_get_connection_protocol_pair_list (); + + priv->security = modest_combo_box_new (priv->security_protos, g_str_equal); hbox = gtk_hbox_new (FALSE, 6); label = gtk_label_new(NULL); @@ -243,9 +250,11 @@ imap_pop_configuration (ModestStoreWidget *self) gtk_label_set_text (GTK_LABEL(label),_("Authentication:")); gtk_box_pack_start (GTK_BOX(hbox), label, FALSE, FALSE, 6); - protos = modest_protocol_info_get_auth_protocol_pair_list (; - priv->auth = modest_combo_box_new (protos, g_str_equal); - modest_pair_list_free (protos); + /* Note: This ModestPairList* must exist for as long as the combo + * that uses it, because the ModestComboBox uses the ID opaquely, + * so it can't know how to manage its memory. */ + priv->auth_protos = modest_protocol_info_get_auth_protocol_pair_list (); + priv->auth = modest_combo_box_new (priv->auth_protos, g_str_equal); gtk_box_pack_start (GTK_BOX(hbox), priv->auth, FALSE, FALSE, 0); @@ -262,6 +271,12 @@ imap_pop_configuration (ModestStoreWidget *self) static void modest_store_widget_finalize (GObject *obj) { + ModestStoreWidgetPrivate *priv = MODEST_STORE_WIDGET_GET_PRIVATE(obj); + + /* These had to stay alive for as long as the comboboxes that used them: */ + modest_pair_list_free (priv->security_protos); + modest_pair_list_free (priv->auth_protos); + G_OBJECT_CLASS(parent_class)->finalize (obj); }