ok, great, thank you! yes, I see now that every call of the canvas_deletelinesfor() in the src folder is as you wrote below. I forget now what I was using for reference when I wrote this — very possibly it was from some random third party object. I’ll go through and check the other bits of the code to make sure it’s in line with the g_text and iemguis.
thanks again, rama
On Apr 11, 2015, at 12:53 PM, IOhannes m zmölnig zmoelnig@iem.at wrote:
On 04/10/2015 12:08 AM, Rama Gottfried wrote:
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.
well, since Pd doesn't have much documentation for writing externals, the best way is usually to look at existing (and working) externals and how they solved the issues at hand.
now i did a quick check (e.g. g_text.c and all iemguis which use g_all_guis.c), and all of them simply call: canvas_deletelinesfor(glist, (t_text*)z); with 'glist' and 'z' being passed to the delete function by Pd - no fancy glist_getcanvas() to convert the glist to it's displaying) canvas.
and indeed, changing your line: -canvas_deletelinesfor(canvas, ob); to +canvas_deletelinesfor(glist, (t_text*)z);
seems to fix all your problems.
fmsadr IOhannes
Pd-dev mailing list Pd-dev@lists.iem.at http://lists.puredata.info/listinfo/pd-dev