Permalink
Browse files

GUI objects must have a deletefn with canvas_deletelinesfor() or they…

… crash on close
  • Loading branch information...
1 parent 090ed04 commit 927f275d4eac0354e5d79df2fb49f4105a1b4774 @eighthave eighthave committed Apr 6, 2012
Showing with 6 additions and 1 deletion.
  1. +6 −1 filterview.c
View
@@ -75,6 +75,11 @@ static void filterview_select(t_gobj *z, t_glist *glist, int state)
sys_vgui("::filterview::select %s %d\n", x->my, state);
}
+void filterview_delete(t_gobj *z, t_glist *glist)
+{
+ canvas_deletelinesfor(glist, (t_text *)z);
+}
+
static void filterview_vis(t_gobj *z, t_glist *glist, int vis)
{
t_filterview* x = (t_filterview*)z;
@@ -235,7 +240,7 @@ void filterview_setup(void)
filterview_widgetbehavior.w_displacefn = filterview_displace;
filterview_widgetbehavior.w_selectfn = filterview_select;
filterview_widgetbehavior.w_activatefn = NULL;
- filterview_widgetbehavior.w_deletefn = NULL;
+ filterview_widgetbehavior.w_deletefn = filterview_delete;
filterview_widgetbehavior.w_visfn = filterview_vis;
filterview_widgetbehavior.w_clickfn = NULL;
class_setwidget(filterview_class, &filterview_widgetbehavior);

0 comments on commit 927f275

Please sign in to comment.