[asterisk-dev] [asterisk-commits] russell: trunk r90351 - in /trunk: ./ apps/ channels/ include/asterisk/ main/

Russell Bryant russell at digium.com
Fri Nov 30 15:58:01 CST 2007


Luigi Rizzo wrote:
> Ok, i think this is a reasonable decision on the grounds of the additional
> robustness it gives - we shouldn't see anymore things like
> 
> 	ao2_link(queues, q);
> 	queue_ref(q);
> 
> where q was invalid after the ao2_link.

Yep, I noticed that, as well.  I did point out to the author of that code that
incrementing the reference count before ao2_link() would have avoided the bug.

> For the records, the reason we made ao2_link() inherit the reference
> was that we expected it to be the normal case: create an object, fill it up
> appropriately, and then put it into a container and be done with it.
> I have to admit that, at least judging from this commit, our assumption
> was true only by a very small margin, and in any case the robustness
> implications are more important

That was exactly what I figured.  I also knew that you would respond if you
didn't like it.  And, if it looked like maybe you didn't see it, I would have
contacted you directly.  :)

Thanks for the feedback,

-- 
Russell Bryant
Senior Software Engineer
Open Source Team Lead
Digium, Inc.



More information about the asterisk-dev mailing list