When a widget is removed (through Widget::removeChild) we've to remove it from its ui::Manager

A widget without parent, cannot be part of the Manager (e.g. cannot be
the capture widget, or focused, or the widget with mouse).
This commit is contained in:
David Capello 2013-04-03 19:54:40 -03:00
parent dcd8627406
commit 1d76e0d545

View File

@ -477,6 +477,11 @@ void Widget::removeChild(Widget* child)
if (it != m_children.end())
m_children.erase(it);
// Free from manager
Manager* manager = getManager();
if (manager)
manager->freeWidget(this);
child->m_parent = NULL;
}