From c61b6fad7da6d3ed876e98d048e729f58b20d9c4 Mon Sep 17 00:00:00 2001 From: Paul Cornett Date: Thu, 23 Dec 2021 11:39:25 -0800 Subject: [PATCH] Avoid an unnecessary gtk_tree_path_copy() --- src/gtk/dataview.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gtk/dataview.cpp b/src/gtk/dataview.cpp index 4bcb68a144..bed3157aa9 100644 --- a/src/gtk/dataview.cpp +++ b/src/gtk/dataview.cpp @@ -1832,11 +1832,10 @@ bool wxGtkDataViewModelNotifier::ItemDeleted( const wxDataViewItem &parent, cons GtkTreeIter parentIter; parentIter.stamp = wxgtk_model->stamp; parentIter.user_data = (gpointer) parent.GetID(); - wxGtkTreePath parentPath(wxgtk_tree_model_get_path( + wxGtkTreePath path(wxgtk_tree_model_get_path( GTK_TREE_MODEL(wxgtk_model), &parentIter )); // and add the final index ourselves - wxGtkTreePath path(gtk_tree_path_copy(parentPath)); int index = m_internal->GetIndexOf( parent, item ); gtk_tree_path_append_index( path, index ); #endif @@ -1849,10 +1848,11 @@ bool wxGtkDataViewModelNotifier::ItemDeleted( const wxDataViewItem &parent, cons // Did we remove the last child, causing 'parent' to become a leaf? if ( !m_wx_model->IsContainer(parent) ) { + gtk_tree_path_up(path); gtk_tree_model_row_has_child_toggled ( GTK_TREE_MODEL(wxgtk_model), - parentPath, + path, &parentIter ); }