[PD-dev] getting the classname in an class
Martin Peach
martin.peach at sympatico.ca
Mon Oct 29 01:47:18 CET 2007
Hans-Christoph Steiner wrote:
>
> I tried this in entry_new() and entry_save(), and in both, "binbuf"
> ends being nothing useful (i.e. segfault):
>
> t_glist *glist = (t_glist *) canvas_getcurrent();
> t_canvas *canvas = (t_canvas*) glist_getcanvas(glist);
> t_binbuf *binbuf = canvas->gl_obj.te_binbuf;
> t_atom *ap = binbuf_getvec(binbuf);
> t_symbol *classname = atom_getsymbol(ap);
>
> What's going on here? Am I doing something wrong?
>
I don't know what you're trying to do but it's normal to check for NULL
pointers after each of the above statements. That should give you a clue.
I suspect that the binbuf doesn't exist if you didn't allocate it yourself.
Martin
More information about the Pd-dev
mailing list