[PD] closebang and initbang in Vanilla

Miller Puckette msp at ucsd.edu
Tue Jan 19 17:22:13 CET 2016


Good, thanks.

Next: for people who are trying to close OS resources when Pd quits, I'm
thinking there should be a fourth phase, "LB_PANIC", which objects should
not respond to by passing messages but only closing resources.

cheers
Miller

On Tue, Jan 19, 2016 at 02:07:32PM +0100, IOhannes m zmölnig wrote:
> On 01/19/2016 10:00 AM, IOhannes m zmoelnig wrote:
> > a first test with iemlib's [init] exhibits triggers on initbang and
> > loadbang, but not on closebang...i might miss something though
> 
> found the culprit: canvas_closebang() never gets called when deleting an
> abstraction.
> 
> attached patch fixes this.
> 
> gfmsadr
> IOhannes

> From fc83f3253f7b1e661a270f7ada9e47ccd8314466 Mon Sep 17 00:00:00 2001
> From: IOhannes m zmoelnig <zmoelnig at umlautQ.umlaeute.mur.at>
> Date: Tue, 19 Jan 2016 14:04:48 +0100
> Subject: [PATCH] emit closebang before an abstraction is closed
> 
> ---
>  src/g_graph.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/src/g_graph.c b/src/g_graph.c
> index d01c803..eb347a1 100644
> --- a/src/g_graph.c
> +++ b/src/g_graph.c
> @@ -62,6 +62,9 @@ int canvas_setdeleting(t_canvas *x, int flag)
>      return (ret);
>  }
>  
> +    /* JMZ: emit a closebang message */
> +void canvas_closebang(t_canvas *x);
> +
>      /* delete an object from a glist and free it */
>  void glist_delete(t_glist *x, t_gobj *y)
>  {
> @@ -73,6 +76,11 @@ void glist_delete(t_glist *x, t_gobj *y)
>      int drawcommand = class_isdrawcommand(y->g_pd);
>      int wasdeleting;
>  
> +    if (pd_class(&y->g_pd) == canvas_class) {
> +            /* JMZ: send a closebang to the canvas */
> +        canvas_closebang((t_canvas *)y);
> +    }
> +
>      wasdeleting = canvas_setdeleting(canvas, 1);
>      if (x->gl_editor)
>      {
> -- 
> 2.7.0.rc3
> 




> _______________________________________________
> Pd-list at lists.iem.at mailing list
> UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list




More information about the Pd-list mailing list