summaryrefslogtreecommitdiff
path: root/src/caja-places-sidebar.c
diff options
context:
space:
mode:
authorJasmine Hassan <[email protected]>2012-10-27 11:30:45 +0200
committerJasmine Hassan <[email protected]>2012-11-16 09:45:50 +0200
commit3434cb86b4a292da136bccd86d5ab9a10707b113 (patch)
tree3d88909419c45e222778f0d611eb4d4d2e9b0bad /src/caja-places-sidebar.c
parente9f10bb18e0b8e0c39c28630b7aab6d739afc80b (diff)
downloadcaja-3434cb86b4a292da136bccd86d5ab9a10707b113.tar.bz2
caja-3434cb86b4a292da136bccd86d5ab9a10707b113.tar.xz
[pathbar] make sure |path| is always valid and memory released
http://git.gnome.org/browse/nautilus/commit/?id=a43bc7def3976947b9624113d18167211e76f9b8
Diffstat (limited to 'src/caja-places-sidebar.c')
-rw-r--r--src/caja-places-sidebar.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/caja-places-sidebar.c b/src/caja-places-sidebar.c
index 71d0bd59..78837dd3 100644
--- a/src/caja-places-sidebar.c
+++ b/src/caja-places-sidebar.c
@@ -823,6 +823,11 @@ over_eject_button (CajaPlacesSidebar *sidebar,
}
out:
+ if (*path != NULL) {
+ gtk_tree_path_free (*path);
+ *path = NULL;
+ }
+
return FALSE;
}
@@ -833,12 +838,11 @@ clicked_eject_button (CajaPlacesSidebar *sidebar,
GdkEvent *event = gtk_get_current_event ();
GdkEventButton *button_event = (GdkEventButton *) event;
- *path = NULL;
-
if ((event->type == GDK_BUTTON_PRESS || event->type == GDK_BUTTON_RELEASE) &&
over_eject_button (sidebar, button_event->x, button_event->y, path)) {
return TRUE;
}
+
return FALSE;
}
@@ -2609,6 +2613,8 @@ bookmarks_button_release_event_cb (GtkWidget *widget,
GtkTreeView *tree_view;
gboolean ret;
+ path = NULL;
+
if (event->type != GDK_BUTTON_RELEASE)
{
return TRUE;
@@ -2703,17 +2709,15 @@ bookmarks_motion_event_cb (GtkWidget *widget,
GtkTreeModel *model;
model = GTK_TREE_MODEL (sidebar->filter_model);
+ path = NULL;
if (over_eject_button (sidebar, event->x, event->y, &path)) {
update_eject_buttons (sidebar, path);
+ gtk_tree_path_free (path);
} else {
update_eject_buttons (sidebar, NULL);
}
- if (path) {
- gtk_tree_path_free (path);
- }
-
return TRUE;
}