Hi IOhannes, thanks so much for taking a look — this fixed the sub-patcher crash and error message issue which is great, but now I have a similar issue on close when the sub-patcher is a GOP.
Could this also be due to something in my delete routine? I tried placing a check for glist->gl_isgraph before canvas_deletelinesfor() and list_eraseiofor(), but so far haven’t been able to avoid the crash.
attaching the current basicgui.c and a test patch below.
thanks again, Rama
On Apr 9, 2015, at 2:08 PM, IOhannes m zmölnig zmoelnig@iem.at wrote:
On 04/08/2015 05:55 AM, Rama Gottfried wrote:
Dear list, I found something that seems like a bug to me, but I’m still not sure, it could be something in my code. Could someone take a look and tell me if I’m doing something incorrectly?
The GUI object pasted below will sometimes crash on close when in a sub-patcher, but not in a top level patcher.
What is confusing to me is that the order of objects in the .pd file seems to make a difference.
On my system this patch crashes on close with a Segmentation Fault: 11:
here it doesn't crash, but gives me an "error: consistency check failed: drawline".
in any case, i think you should call `canvas_deletelinesfor()` unconditionally, even if the object is not visible. something like:
static void basicgui_delete(t_gobj *z, t_glist *glist) { printf("%s %p \n", __FUNCTION__, z); t_canvas *canvas = glist_getcanvas(glist); t_basicgui *x = (t_basicgui *)z; t_object *ob = pd_checkobject(&x->ob.te_pd); if(canvas->gl_editor) { sys_vgui(".x%lx.c delete %lxBOX \n", glist_getcanvas(glist), z ); } if(ob && glist_isvisible(glist)) { glist_eraseiofor(glist, ob, x->io_tag); } canvas_deletelinesfor(canvas, ob); }
mfsdr IOhannes
PS: for the future, could you *attach* your files rather than paste them inline? it makes it so much easier to try them out.
Pd-dev mailing list Pd-dev@lists.iem.at http://lists.puredata.info/listinfo/pd-dev