Segfault pressing Menu key (was Small bug)

Sergey Starosek sergey.starosek at gmail.com
Tue Jan 29 03:17:48 PST 2013


2013/1/29 Henrik Brautaset Aronsen <subsurface at henrik.synth.no>:
>
> This patch should fix it:
>
> diff --git a/divelist.c b/divelist.c
> index b31c9ac..290baba 100644
> --- a/divelist.c
> +++ b/divelist.c
> @@ -2353,7 +2353,7 @@ static void popup_divelist_menu(GtkTreeView
> *tree_view, GtkTreeModel *model, int
>         int idx, previdx, nextidx;
>         struct dive *dive;
>
> -       if (!gtk_tree_view_get_path_at_pos(tree_view, event->x, event->y,
> &path, NULL, NULL, NULL))
> +       if (!event || !gtk_tree_view_get_path_at_pos(tree_view, event->x,
> event->y, &path, NULL, NULL, NULL))
>                 return;
>         gtk_tree_model_get_iter(MODEL(dive_list), &iter, path);
>         gtk_tree_model_get(MODEL(dive_list), &iter, DIVE_INDEX, &idx, -1);

It fixes segfault, thanks. But Menu button does not work while it should.

Sergey


More information about the subsurface mailing list