[PD] [devel] the joy of global variables, part 2

Krzysztof Czaja czaja at chopin.edu.pl
Sat Sep 22 19:22:18 CEST 2001


hi again,

I have also found out, why creating an object with arguments, but
of an unknown class, results in the next created canvas inheriting
those arguments (remember `whoami' riddle?).

The remedy: a call to canvas_setargs() in m_class.c/new_anything()
should not be made before open_via_path() call, but only after
succesful return from that call.  For example:

-    canvas_setargs(argc, argv);
     if ((fd = open_via_path(dir->s_name, s->s_name, ".pd",
        dirbuf, &nameptr, MAXPDSTRING, 0)) >= 0)
     {
        close (fd);
        if (!pd_setloadingabstraction(s))
        {
+           canvas_setargs(argc, argv);
            binbuf_evalfile(gensym(nameptr), gensym(dirbuf));

or in a similar way.

K-ind-of



More information about the Pd-list mailing list