pioneerspacesim/pioneer — pull request #1642 by robn (2012-10-29 00:26:21+00:00)
Title: Make AddWidget "steal" a widget if it already belongs to another container

The assert that was at the top of AddWidget is surprisingly easy to trip when you're doing things with a lot of widgets and event handlers. This makes it do somehing sane. To do it we need an always-reliable method of removing a widget from any container. As a result, RemoveWidget() is now virtual and any container that tracks its children independently of Container needs to implement it.

@Brianetta's test case (for `new-ui-infoview` @9bf87e07): http://pastebin.com/qCGmmJbU