[gtk+/open-with-dialog: 5/53] open-with: cope with NULL GAppInfo



commit ee9a7a3baf1bf150eb6ad2f3796807921051a3bb
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Tue Nov 16 15:13:11 2010 +0100

    open-with: cope with NULL GAppInfo
    
    It's not that the GAppInfo can actually be NULL, but we use the store to
    save headings too, which have no GAppInfo in their rows.

 gtk/gtkopenwithdialog.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkopenwithdialog.c b/gtk/gtkopenwithdialog.c
index bd3929a..c0ad120 100644
--- a/gtk/gtkopenwithdialog.c
+++ b/gtk/gtkopenwithdialog.c
@@ -334,11 +334,15 @@ gtk_open_with_dialog_response (GtkDialog *dialog,
 		      gtk_tree_model_get (model, &iter,
 					  COLUMN_APP_INFO, &info,
 					  -1);
-		      if (g_app_info_equal (selected, info))
+		      if (info != NULL && g_app_info_equal (selected, info))
 			{
 			  gtk_list_store_remove (self->priv->program_list_store, &iter);
+			  g_object_unref (info);
 			  break;
 			}
+
+		      if (info != NULL)
+			g_object_unref (info);
 		    }
 		  while (gtk_tree_model_iter_next (model, &iter));
 		}



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