[libdazzle] tree: avoid g_autoptr(GtkTreePath)



commit eace2f8291825034a215aca523eb475aa809fbd0
Author: Christian Hergert <chergert redhat com>
Date:   Tue Dec 5 04:47:15 2017 -0800

    tree: avoid g_autoptr(GtkTreePath)
    
    Didn't mean to use this until stuff landed in Gtk

 src/tree/dzl-tree-store.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/src/tree/dzl-tree-store.c b/src/tree/dzl-tree-store.c
index 4897c65..a25ae10 100644
--- a/src/tree/dzl-tree-store.c
+++ b/src/tree/dzl-tree-store.c
@@ -217,14 +217,18 @@ dzl_tree_store_drag_data_received (GtkTreeDragDest  *dest,
    */
   if (gtk_selection_data_get_target (data) == gdk_atom_intern_static_string ("GTK_TREE_MODEL_ROW"))
     {
-      g_autoptr(GtkTreePath) src_path = NULL;
+      GtkTreePath *src_path = NULL;
       GtkTreeModel *model = NULL;
 
       if (gtk_tree_get_row_drag_data (data, &model, &src_path))
         {
           GtkTreeIter iter;
+          gboolean found;
 
-          if (gtk_tree_model_get_iter (model, &iter, src_path))
+          found = gtk_tree_model_get_iter (model, &iter, src_path);
+          g_clear_pointer (&src_path, gtk_tree_path_free);
+
+          if (found)
             {
               g_autoptr(DzlTreeNode) drag_node = NULL;
 


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