# HG changeset patch # User Daniel Atallah # Date 1159929137 0 # Node ID beabf64760e885ec32a1843e0f1236dc841e00f3 # Parent 44fb5200c7bbf48b7bd19330c01b81f3c990f73a [gaim-migrate @ 17425] Oops, I leaked. committer: Tailor Script diff -r 44fb5200c7bb -r beabf64760e8 gtk/gtkstatusbox.c --- a/gtk/gtkstatusbox.c Tue Oct 03 01:59:32 2006 +0000 +++ b/gtk/gtkstatusbox.c Wed Oct 04 02:32:17 2006 +0000 @@ -712,7 +712,6 @@ GtkTreeIter iter; GtkGaimStatusBoxItemType type; gpointer data; - const char *name; /* Unset the active item */ gtk_combo_box_set_active(GTK_COMBO_BOX(status_box), -1); @@ -724,21 +723,27 @@ { gtk_tree_model_get(GTK_TREE_MODEL(status_box->dropdown_store), &iter, TYPE_COLUMN, &type, - TEXT_COLUMN, &name, DATA_COLUMN, &data, -1); if (status_box->token_status_account && gaim_savedstatus_is_transient(saved_status) && type == GTK_GAIM_STATUS_BOX_TYPE_PRIMITIVE && primitive == GPOINTER_TO_INT(data)) { + char *name; const char *acct_status_name = gaim_status_get_name( gaim_account_get_active_status(status_box->token_status_account)); + + gtk_tree_model_get(GTK_TREE_MODEL(status_box->dropdown_store), &iter, + TEXT_COLUMN, &name, -1); + if (!gaim_savedstatus_has_substatuses(saved_status) || !strcmp(name, acct_status_name)) { /* Found! */ gtk_combo_box_set_active_iter(GTK_COMBO_BOX(status_box), &iter); + g_free(name); break; } + g_free(name); } else if ((type == GTK_GAIM_STATUS_BOX_TYPE_POPULAR) && (GPOINTER_TO_INT(data) == gaim_savedstatus_get_creation_time(saved_status)))