[gnome-control-center] online-accounts: We might have an object even when the error is set



commit 651431dd839702f36c46a8dfe0702471b9b3b145
Author: Debarshi Ray <debarshir gnome org>
Date:   Mon Apr 16 20:22:42 2012 +0200

    online-accounts: We might have an object even when the error is set
    
    Fixes: https://bugzilla.gnome.org/674165

 panels/online-accounts/cc-online-accounts-panel.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/panels/online-accounts/cc-online-accounts-panel.c b/panels/online-accounts/cc-online-accounts-panel.c
index 3f828ae..729b025 100644
--- a/panels/online-accounts/cc-online-accounts-panel.c
+++ b/panels/online-accounts/cc-online-accounts-panel.c
@@ -497,6 +497,11 @@ on_toolbar_add_button_clicked (GtkToolButton *button,
 
   error = NULL;
   object = goa_panel_add_account_dialog_get_account (GOA_PANEL_ADD_ACCOUNT_DIALOG (dialog), &error);
+  gtk_widget_destroy (dialog);
+
+  /* We might have an object even when error is set.
+   * eg., if we failed to store the credentials in the keyring.
+   */
 
   if (object != NULL)
     {
@@ -510,11 +515,10 @@ on_toolbar_add_button_clicked (GtkToolButton *button,
                                           &iter);
         }
       g_object_unref (object);
-      gtk_widget_destroy (dialog);
     }
-  else
+
+  if (error != NULL)
     {
-      gtk_widget_destroy (dialog);
       if (!(error->domain == GOA_ERROR && error->code == GOA_ERROR_DIALOG_DISMISSED))
         {
           dialog = gtk_message_dialog_new (parent,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]