- list = get_msg_formats ();
- combo = modest_combo_box_new (list, g_int_equal);
- modest_pair_list_free (list);
+
+ ModestGlobalSettingsDialogPrivate *ppriv =
+ MODEST_GLOBAL_SETTINGS_DIALOG_GET_PRIVATE (self);
+
+ /* 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. */
+ ppriv->combo_msg_formats_list = _modest_global_settings_dialog_get_msg_formats ();
+ combo = modest_combo_box_new (ppriv->cmsg_formats_list, g_int_equal);
+