mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
free GtkTreePath after calling gtk_tree_view_get_path_at_pos
This commit is contained in:
parent
8a48ed9777
commit
e13644dffc
@ -423,6 +423,7 @@ custom_report_list_view_clicked_cb(GtkTreeView *view, GdkEventButton *event, gpo
|
||||
{
|
||||
SCM guid = get_custom_report_selection(crd, _("You must select a report configuration to load."));
|
||||
custom_report_run_report (guid, crd);
|
||||
gtk_tree_path_free (path);
|
||||
return TRUE;
|
||||
}
|
||||
else if (column == crd->editcol)
|
||||
@ -430,14 +431,17 @@ custom_report_list_view_clicked_cb(GtkTreeView *view, GdkEventButton *event, gpo
|
||||
g_object_set(G_OBJECT(crd->namerenderer), "editable", TRUE, NULL);
|
||||
gtk_tree_view_set_cursor_on_cell (view, path, crd->namecol,
|
||||
crd->namerenderer, TRUE);
|
||||
gtk_tree_path_free (path);
|
||||
return TRUE;
|
||||
}
|
||||
else if (column == crd->delcol)
|
||||
{
|
||||
SCM guid = get_custom_report_selection(crd, _("You must select a report configuration to delete."));
|
||||
custom_report_delete (guid, crd);
|
||||
gtk_tree_path_free (path);
|
||||
return TRUE;
|
||||
}
|
||||
gtk_tree_path_free (path);
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
@ -489,10 +493,12 @@ custom_report_query_tooltip_cb (GtkTreeView *view,
|
||||
gtk_tooltip_set_text (tooltip, _("Edit report configuration name"));
|
||||
else if (column == crd->delcol)
|
||||
gtk_tooltip_set_text (tooltip, _("Delete report configuration"));
|
||||
gtk_tree_path_free (path);
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
gtk_tooltip_set_text (tooltip, NULL);
|
||||
gtk_tree_path_free (path);
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -945,19 +945,31 @@ query_tooltip_tree_view_cb (GtkWidget *widget, gint x, gint y,
|
||||
|
||||
if (keyboard_tip || !gtk_tree_view_get_path_at_pos (tree_view, x, y, &path,
|
||||
&column, NULL, NULL))
|
||||
{
|
||||
gtk_tree_path_free (path);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!column)
|
||||
{
|
||||
gtk_tree_path_free (path);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
period_num = GPOINTER_TO_UINT(g_object_get_data (G_OBJECT(column), "period_num"));
|
||||
if (!period_num && priv->period_col_list->data != column)
|
||||
{
|
||||
gtk_tree_path_free (path);
|
||||
return FALSE;
|
||||
}
|
||||
account = gnc_tree_view_account_get_account_from_path (
|
||||
GNC_TREE_VIEW_ACCOUNT(widget), path);
|
||||
note = gnc_budget_get_account_period_note (priv->budget, account, period_num);
|
||||
if (!note)
|
||||
{
|
||||
gtk_tree_path_free (path);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
gtk_tooltip_set_text (tooltip, note);
|
||||
gtk_tree_view_set_tooltip_cell (tree_view, tooltip, path, column, NULL);
|
||||
|
@ -1898,7 +1898,10 @@ query_tooltip_tree_view_cb (GtkWidget *widget, gint x, gint y,
|
||||
gtk_tree_view_convert_widget_to_bin_window_coords (tree_view, x, y, &x, &y);
|
||||
if (keyboard_tip || !gtk_tree_view_get_path_at_pos (tree_view, x, y, &path,
|
||||
&column, NULL, NULL))
|
||||
{
|
||||
gtk_tree_path_free (path);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// Get the iter pointing to our current column
|
||||
if (gtk_tree_model_get_iter(model, &iter, path) && column)
|
||||
|
Loading…
Reference in New Issue
Block a user