[gnome-builder] todo: cleanup to use g_autoptr



commit cdc3d38a7311a78b0c42bae233e73690be9c9473
Author: Diego Escalante Urrelo <diegoe gnome org>
Date:   Sat Jun 27 03:15:26 2020 -0500

    todo: cleanup to use g_autoptr

 src/plugins/todo/gbp-todo-panel.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
---
diff --git a/src/plugins/todo/gbp-todo-panel.c b/src/plugins/todo/gbp-todo-panel.c
index b4ac31550..552eadd95 100644
--- a/src/plugins/todo/gbp-todo-panel.c
+++ b/src/plugins/todo/gbp-todo-panel.c
@@ -160,7 +160,7 @@ gbp_todo_panel_query_tooltip (GbpTodoPanel *self,
                               GtkTooltip   *tooltip,
                               GtkTreeView  *tree_view)
 {
-  GtkTreePath *path = NULL;
+  g_autoptr(GtkTreePath) path = NULL;
   GtkTreeModel *model;
 
   g_assert (GBP_IS_TODO_PANEL (self));
@@ -199,11 +199,9 @@ gbp_todo_panel_query_tooltip (GbpTodoPanel *self,
           g_string_append (str, "</tt>");
           gtk_tree_view_set_tooltip_row (tree_view, tooltip, path);
           gtk_tooltip_set_markup (tooltip, str->str);
-        }
-
-      gtk_tree_path_free (path);
 
-      return TRUE;
+         return TRUE;
+        }
     }
 
   return FALSE;


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