[PD-dev] 0.42.5 pd-extended crashes

Ivica Ico Bukvic ico at vt.edu
Mon Nov 2 18:08:26 CET 2009


So I finally traced this down to the following call in g_editor.c.

I am not however submitting the patch as I am not entirely sure this is
the right approach or a solution without regressions.

    else    /* make invisible */
    {
        int i;
        t_canvas *x2;
        if (!x->gl_havewindow)
        {
                /* bug workaround -- a graph in a visible patch gets
"invised"
                when the patch is closed, and must lose the editor here.
It's
                probably not the natural place to do this.  Other cases
like
                subpatches fall here too but don'd need the editor
freed, so
                we check if it exists. */
            if (x->gl_editor)
                canvas_destroy_editor(x);
            return;
        }
	//Commenting call below out apparently solves the problem
	//however, I am also
	//not sure what are other potential regressions
	//Curiosity question: why do we need to get scroll on something
	//that we are closing anyhow?
	//BEGIN OFFENDING CALL
        //sys_vgui("pdtk_canvas_getscroll .x%lx.c\n", x);
	//END OFFENDING CALL
        glist_noselect(x);
        if (glist_isvisible(x))
            canvas_map(x, 0);
        if (x->gl_editor)
			canvas_destroy_editor(x);
        sys_vgui("destroy .x%lx\n", x);
        for (i = 1, x2 = x; x2; x2 = x2->gl_next, i++)
            ;
        sys_vgui(".mbar.find delete %d\n", i);
            /* if we're a graph on our parent, and if the parent exists
               and is visible, show ourselves on parent. */
        if (glist_isgraph(x) && x->gl_owner)
        {
            t_glist *gl2 = x->gl_owner;
            if (glist_isvisible(gl2))
                gobj_vis(&x->gl_gobj, gl2, 0);
            x->gl_havewindow = 0;
            if (glist_isvisible(gl2))
                gobj_vis(&x->gl_gobj, gl2, 1);
        }
        else x->gl_havewindow = 0;
        canvas_updatewindowlist();
    }





More information about the Pd-dev mailing list