[PD-dev] GUI object crash on close when in subpatcher

IOhannes m zmölnig zmoelnig at iem.at
Sat Apr 11 21:53:14 CEST 2015

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);
+canvas_deletelinesfor(glist, (t_text*)z);

seems to fix all your problems.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.puredata.info/pipermail/pd-dev/attachments/20150411/8ced4a90/attachment.sig>

More information about the Pd-dev mailing list