Gtk::TreeView::get_cursor() is leaking?



Hi,

I have used valgrind to test my application for leaking memory.
So, I've found that Gtk::TreeView::get_cursor() is "definitly leaking"
when getting path parameter.

GTK+ doc said that after call to gtk_tree_view_get_cursor() "The
returned GtkTreePath must be freed with gtk_tree_path_free() when you
are done with it".

I don't see that here (treeview.cc):

void TreeView::get_cursor(TreeModel::Path& path, TreeViewColumn*& focus_column)
{
  GtkTreePath* pTreePath = 0;
  GtkTreeViewColumn* pTreeViewColumn = 0;
  gtk_tree_view_get_cursor(gobj(), &pTreePath, &pTreeViewColumn);

  path = TreeModel::Path(pTreePath, true);
  focus_column = Glib::wrap(pTreeViewColumn);
}

Since TreeModel::Path() constructor takes copy of the GtkTreePath, we
may just add at the end of the get_cursor() function:

gtk_tree_path_free( pTreePath );

I am confused that this easy to fix issue saved thru all gtkmm versions.
So, I would to ask is it a bug or not a bug?

Regards,
-andrew





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