summaryrefslogtreecommitdiff
path: root/gtk/gtkfilechooserdefault.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2010-03-08 23:56:43 -0500
committerMatthias Clasen <mclasen@redhat.com>2010-03-08 23:56:43 -0500
commitbf88eee1318eb4c47c31ad1b32f515bb6c5d37f2 (patch)
treede34b8ac1a054d70d013b5bf663e6a5404f96d33 /gtk/gtkfilechooserdefault.c
parent2036d9262e84feed7d89e22a25cf1918c598c797 (diff)
downloadgtk+-bf88eee1318eb4c47c31ad1b32f515bb6c5d37f2.tar.gz
Fix file chooser refcounting issues
This was reported in bug 600992.
Diffstat (limited to 'gtk/gtkfilechooserdefault.c')
-rw-r--r--gtk/gtkfilechooserdefault.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/gtk/gtkfilechooserdefault.c b/gtk/gtkfilechooserdefault.c
index eefe49c56d..81150d07ec 100644
--- a/gtk/gtkfilechooserdefault.c
+++ b/gtk/gtkfilechooserdefault.c
@@ -762,14 +762,12 @@ shortcuts_free_row_data (GtkFileChooserDefault *impl,
GtkFileSystemVolume *volume;
volume = col_data;
- _gtk_file_system_volume_free (volume);
+ _gtk_file_system_volume_unref (volume);
}
- else
+ if (shortcut_type == SHORTCUT_TYPE_FILE)
{
GFile *file;
- g_assert (shortcut_type == SHORTCUT_TYPE_FILE);
-
file = col_data;
g_object_unref (file);
}
@@ -2015,7 +2013,14 @@ shortcuts_add_volumes (GtkFileChooserDefault *impl)
}
}
- shortcuts_insert_file (impl, start_row + n, SHORTCUT_TYPE_VOLUME, volume, NULL, NULL, FALSE, SHORTCUTS_VOLUMES);
+ shortcuts_insert_file (impl,
+ start_row + n,
+ SHORTCUT_TYPE_VOLUME,
+ _gtk_file_system_volume_ref (volume),
+ NULL,
+ NULL,
+ FALSE,
+ SHORTCUTS_VOLUMES);
n++;
}
@@ -3437,9 +3442,7 @@ shortcuts_query_tooltip_cb (GtkWidget *widget,
if (shortcut_type == SHORTCUT_TYPE_SEPARATOR)
return FALSE;
else if (shortcut_type == SHORTCUT_TYPE_VOLUME)
- {
- return FALSE;
- }
+ return FALSE;
else if (shortcut_type == SHORTCUT_TYPE_FILE)
{
GFile *file;
@@ -9770,6 +9773,9 @@ shortcuts_activate_mount_enclosing_volume (GCancellable *cancellable,
_gtk_file_system_get_info (data->impl->file_system, data->file,
"standard::type",
shortcuts_activate_get_info_cb, data);
+
+ if (volume)
+ _gtk_file_system_volume_unref (volume);
}
static void