summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Neumair <cneumair@gnome.org>2008-07-31 10:53:06 +0000
committerChristian Neumair <cneumair@src.gnome.org>2008-07-31 10:53:06 +0000
commitccc3c76f6121e9f33e5cd96bc2da980bdc29eb29 (patch)
tree73bc28e35ff81ac70b149c886f5bb8912d4f797e
parentdfa3f740dbbf4f3537b3bfc8fa4783818b68e892 (diff)
downloadnautilus-ccc3c76f6121e9f33e5cd96bc2da980bdc29eb29.tar.gz
Handle NULL string arrays, and fix combo box model reference counting.
2008-07-31 Christian Neumair <cneumair@gnome.org> * libnautilus-private/nautilus-autorun.c (remove_elem_from_str_array), (add_elem_to_str_array), (nautilus_autorun_set_preferences), (combo_box_changed), (nautilus_autorun_prepare_combo_box): Handle NULL string arrays, and fix combo box model reference counting. Fixes #545658. svn path=/branches/gnome-2-22/; revision=14432
-rw-r--r--ChangeLog9
-rw-r--r--libnautilus-private/nautilus-autorun.c11
2 files changed, 16 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 0f591033f..e814ed85e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2008-07-31 Christian Neumair <cneumair@gnome.org>
+
+ * libnautilus-private/nautilus-autorun.c
+ (remove_elem_from_str_array), (add_elem_to_str_array),
+ (nautilus_autorun_set_preferences), (combo_box_changed),
+ (nautilus_autorun_prepare_combo_box):
+ Handle NULL string arrays, and fix combo box model reference counting.
+ Fixes #545658.
+
2008-07-20 David Zeuthen <davidz@redhat.com>
* libnautilus-private/nautilus-file-operations.c
diff --git a/libnautilus-private/nautilus-autorun.c b/libnautilus-private/nautilus-autorun.c
index b778f28d8..faad80942 100644
--- a/libnautilus-private/nautilus-autorun.c
+++ b/libnautilus-private/nautilus-autorun.c
@@ -100,6 +100,11 @@ static void
remove_elem_from_str_array (char **v, const char *s)
{
int n, m;
+
+ if (v == NULL) {
+ return;
+ }
+
for (n = 0; v[n] != NULL; n++) {
if (strcmp (v[n], s) == 0) {
for (m = n + 1; v[m] != NULL; m++) {
@@ -117,7 +122,7 @@ add_elem_to_str_array (char **v, const char *s)
guint len;
char **r;
- len = g_strv_length (v);
+ len = v != NULL ? g_strv_length (v) : 0;
r = g_new0 (char *, len + 2);
memcpy (r, v, len * sizeof (char *));
r[len] = g_strdup (s);
@@ -271,9 +276,6 @@ out:
if (app_info != NULL) {
g_object_unref (app_info);
}
- if (model != NULL) {
- g_object_unref (model);
- }
g_free (x_content_type);
}
@@ -438,6 +440,7 @@ nautilus_autorun_prepare_combo_box (GtkWidget *combo_box,
eel_g_object_list_free (app_info_list);
gtk_combo_box_set_model (GTK_COMBO_BOX (combo_box), GTK_TREE_MODEL (list_store));
+ g_object_unref (G_OBJECT (list_store));
gtk_cell_layout_clear (GTK_CELL_LAYOUT (combo_box));