On Mon, Jan 19, 2009 at 3:19 PM, Marc-Andre Decoste <m...@chromium.org>wrote:

>    I got a crash while playing with new code and I wonder if we should fix
> the view parenting code to avoid this. The problem happens when you try to
> add a child view to a parent view that already has this view as a child.
>

There are a number of subtle gotchas like this in the Views code.  The last
time I ran into something like this, I noted it to acw (the original Views
author, no longer on the project), whose comment was something like "don't
use the API that way".  I tend to feel like a semi-bulletproof API ("easy to
use correctly, hard to use wrong") is best so my instinct would instead be
to fix the code to deal with this.

It seems like calling AddChildView() when a view is already a child should
either do nothing or move the view to the end of the child list.  I don't
use these APIs much so I don't know which is closer to what callers would
expect.

PK

--~--~---------~--~----~------------~-------~--~----~
Chromium Developers mailing list: chromium-dev@googlegroups.com 
View archives, change email options, or unsubscribe: 
    http://groups.google.com/group/chromium-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to