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,12 +4449,17 @@ static void *event_new(void) ...@@ -4449,12 +4449,17 @@ static void *event_new(void)
x->x_bindsym = gensym(namebuf); x->x_bindsym = gensym(namebuf);
pd_bind(&x->x_obj.ob_pd, x->x_bindsym); pd_bind(&x->x_obj.ob_pd, x->x_bindsym);
} }
else
{
x->x_bindsym = 0;
}
outlet_new(&x->x_obj, &s_anything); outlet_new(&x->x_obj, &s_anything);
return (x); return (x);
} }
static void event_free(t_event *x) static void event_free(t_event *x)
{ {
if (x->x_bindsym)
pd_unbind(&x->x_obj.ob_pd, x->x_bindsym); pd_unbind(&x->x_obj.ob_pd, x->x_bindsym);
} }
......
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