forked from AuroraMiddleware/gtk
Don't leak a treepath if the treeview is not populated yet
Signed-off-by: Federico Mena Quintero <federico@novell.com>
This commit is contained in:
parent
35028b9f05
commit
442484a280
@ -6265,12 +6265,13 @@ browse_files_select_first_row (GtkFileChooserDefault *impl)
|
|||||||
GtkTreeIter dummy_iter;
|
GtkTreeIter dummy_iter;
|
||||||
GtkTreeModel *tree_model;
|
GtkTreeModel *tree_model;
|
||||||
|
|
||||||
path = gtk_tree_path_new_from_indices (0, -1);
|
|
||||||
tree_model = gtk_tree_view_get_model (GTK_TREE_VIEW (impl->browse_files_tree_view));
|
tree_model = gtk_tree_view_get_model (GTK_TREE_VIEW (impl->browse_files_tree_view));
|
||||||
|
|
||||||
if (!tree_model)
|
if (!tree_model)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
path = gtk_tree_path_new_from_indices (0, -1);
|
||||||
|
|
||||||
/* If the list is empty, do nothing. */
|
/* If the list is empty, do nothing. */
|
||||||
if (gtk_tree_model_get_iter (tree_model, &dummy_iter, path))
|
if (gtk_tree_model_get_iter (tree_model, &dummy_iter, path))
|
||||||
gtk_tree_view_set_cursor (GTK_TREE_VIEW (impl->browse_files_tree_view), path, NULL, FALSE);
|
gtk_tree_view_set_cursor (GTK_TREE_VIEW (impl->browse_files_tree_view), path, NULL, FALSE);
|
||||||
|
Loading…
Reference in New Issue
Block a user