[L2Ork-dev] Delayed pd_unbind

Albert Graef aggraef at gmail.com
Wed Nov 13 05:19:29 UTC 2013


On Tue, Nov 12, 2013 at 11:34 PM, Ivica Ico Bukvic <ico at vt.edu> wrote:
> That said, you did identify one obvious bug (namely line 266) and thank you
> very much for doing so. I will add that aspect to the next release.

Then could you please also fix the more serious issue at m_pd.c:276
ff. which causes the segfaults? This needs to be rewritten so that it
doesn't assume that the remaining single entry is at the head of the
list. Here's one way you can do that:

        int count_valid = 0;
        t_bindelem *e1 = NULL;
        for (e = b->b_list; e; e = e->e_next)
        {
            if (e->e_who != NULL) {
                count_valid++;
                e1 = e;
            }
        }
        if (count_valid == 1) {
            s->s_thing = e1->e_who;
            if (!change_bindlist_via_graph) {
                freebytes(b->b_list, sizeof(t_bindelem));
                pd_free(&b->b_pd);
            }
        }

I also think that the test for valid list entries at line 278 needs to
be rewritten as follows, so that it properly identifies the list
entries which have been flagged as deleted:

            if (e->e_who != NULL && !e->e_delayed_free)

-- 
Dr. Albert Gr"af
Dept. of Music-Informatics, University of Mainz, Germany
Email:  aggraef at gmail.com
WWW:    https://plus.google.com/+AlbertGraef


More information about the L2Ork-dev mailing list