# HG changeset patch # User Paul Aurich # Date 1257565513 0 # Node ID 6126436715e8990edeed3e630ea6d96073c79338 # Parent 9832ae3b94fdde8d85d84e02d8fa07c7115ebd48 xmppdisco: Close the input request when closing the dialog. Fixes a crash. diff -r 9832ae3b94fd -r 6126436715e8 pidgin/plugins/disco/gtkdisco.c --- a/pidgin/plugins/disco/gtkdisco.c Fri Nov 06 21:28:04 2009 +0000 +++ b/pidgin/plugins/disco/gtkdisco.c Sat Nov 07 03:45:13 2009 +0000 @@ -162,12 +162,15 @@ static void discolist_cancel_cb(PidginDiscoList *pdl, const char *server) { + pdl->dialog->prompt_handle = NULL; + pidgin_disco_list_set_in_progress(pdl, FALSE); pidgin_disco_list_unref(pdl); } static void discolist_ok_cb(PidginDiscoList *pdl, const char *server) { + pdl->dialog->prompt_handle = NULL; gtk_widget_set_sensitive(pdl->dialog->browse_button, TRUE); if (!server || !*server) { @@ -236,7 +239,7 @@ /* Note to translators: The string "Enter an XMPP Server" is asking the user to type the name of an XMPP server which will then be queried */ - purple_request_input(my_plugin, _("Server name request"), _("Enter an XMPP Server"), + dialog->prompt_handle = purple_request_input(my_plugin, _("Server name request"), _("Enter an XMPP Server"), _("Select an XMPP server to query"), server, FALSE, FALSE, NULL, _("Find Services"), PURPLE_CALLBACK(discolist_ok_cb), @@ -390,6 +393,9 @@ PidginDiscoDialog *dialog = d; PidginDiscoList *list = dialog->discolist; + if (dialog->prompt_handle) + purple_request_close(PURPLE_REQUEST_INPUT, dialog->prompt_handle); + if (list) { list->dialog = NULL; diff -r 9832ae3b94fd -r 6126436715e8 pidgin/plugins/disco/gtkdisco.h --- a/pidgin/plugins/disco/gtkdisco.h Fri Nov 06 21:28:04 2009 +0000 +++ b/pidgin/plugins/disco/gtkdisco.h Sat Nov 07 03:45:13 2009 +0000 @@ -43,6 +43,8 @@ PurpleAccount *account; PidginDiscoList *discolist; + + gpointer *prompt_handle; }; struct _PidginDiscoList {