# HG changeset patch # User Paul Aurich # Date 1246988653 0 # Node ID 8a46d5528c3c05370e00bdeba5dba8a93f8116e0 # Parent ebb0f7d27f5b073210fb29da99bfd0d37a1f83da Plug a leak of an account dropdown selection dialog or two. The optmenu was being assigned to the wrong field, meaning it would be created twice (the latter when pidgin_request_fields hits that field). On top of that, the dropdown was being created even when the field isn't visible (which, in the case of one active account and the New IM dialog, it isn't). Fixes a bunch of failed assertions in the debug log like: g_log: purple_request_field_account_set_value: assertion `field->type == PURPLE_REQUEST_FIELD_ACCOUNT' failed diff -r ebb0f7d27f5b -r 8a46d5528c3c pidgin/gtkrequest.c --- a/pidgin/gtkrequest.c Tue Jul 07 05:09:53 2009 +0000 +++ b/pidgin/gtkrequest.c Tue Jul 07 17:44:13 2009 +0000 @@ -717,12 +717,16 @@ GtkWidget *optmenu = NULL; PurpleRequestFieldGroup *group = purple_request_field_get_group(field); GList *fields = group->fields; + + /* Ensure the account option menu is created (if the widget hasn't + * been initialized already) for username auto-completion. */ while (fields) { PurpleRequestField *fld = fields->data; fields = fields->next; - if (purple_request_field_get_type(fld) == PURPLE_REQUEST_FIELD_ACCOUNT) + if (purple_request_field_get_type(fld) == PURPLE_REQUEST_FIELD_ACCOUNT && + purple_request_field_is_visible(fld)) { const char *type_hint = purple_request_field_get_type_hint(fld); if (type_hint != NULL && strcmp(type_hint, "account") == 0) @@ -730,7 +734,7 @@ optmenu = GTK_WIDGET(purple_request_field_get_ui_data(fld)); if (optmenu == NULL) { optmenu = GTK_WIDGET(create_account_field(fld)); - purple_request_field_set_ui_data(field, optmenu); + purple_request_field_set_ui_data(fld, optmenu); } break; }