Commit 8d587fbd authored by Jonathan Wilkes's avatar Jonathan Wilkes
Browse files

fix crasher when [event] is deleted without having bound a symbol

parent de65f674
......@@ -4449,13 +4449,18 @@ static void *event_new(void)
x->x_bindsym = gensym(namebuf);
pd_bind(&x->x_obj.ob_pd, x->x_bindsym);
}
else
{
x->x_bindsym = 0;
}
outlet_new(&x->x_obj, &s_anything);
return (x);
}
static void event_free(t_event *x)
{
pd_unbind(&x->x_obj.ob_pd, x->x_bindsym);
if (x->x_bindsym)
pd_unbind(&x->x_obj.ob_pd, x->x_bindsym);
}
void event_setup(void)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment