[gedit] Fix a memory leak



commit e09d562ed9efcb43e18e9dffd86c1803fa0634f0
Author: Daniel Trebbien <dtrebbien gmail com>
Date:   Sat Feb 11 16:21:24 2012 -0800

    Fix a memory leak
    
    In menu_position(), free the GtkTreePath that was returned by
    get_current_path().
    
    https://bugzilla.gnome.org/show_bug.cgi?id=669917

 gedit/gedit-documents-panel.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
---
diff --git a/gedit/gedit-documents-panel.c b/gedit/gedit-documents-panel.c
index 682f741..b55fe43 100644
--- a/gedit/gedit-documents-panel.c
+++ b/gedit/gedit-documents-panel.c
@@ -771,18 +771,16 @@ menu_position (GtkMenu             *menu,
 	w = panel->priv->treeview;
 
 	path = get_current_path (panel);
-
 	gtk_tree_view_get_cell_area (GTK_TREE_VIEW (w),
 				     path,
 				     NULL,
 				     &rect);
+	gtk_tree_path_free (path);
 
 	wy = rect.y;
 
 	gdk_window_get_origin (gtk_widget_get_window (w), x, y);
-
 	gtk_widget_get_preferred_size (GTK_WIDGET (menu), &requisition, NULL);
-
 	gtk_widget_get_allocation (w, &allocation);
 
 	if (gtk_widget_get_direction (w) == GTK_TEXT_DIR_RTL)



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