BLayout: Don't delete the layout of the view in RemoveView().

The layout item representing the layout of the view to be removed is
owned by the view and must not be deleted. The layout only owns the
item if a new layout item was created when adding the view, i.e. when
it did not have a layout.

Fixes the underlying issue that triggered #11976.
This commit is contained in:
Michael Lotz 2015-04-18 13:18:29 +02:00
parent 1f1df3671c
commit ebea950b2d

View File

@ -209,7 +209,8 @@ BLayout::RemoveView(BView* child)
continue;
RemoveItem(i);
delete item;
if (item != child->GetLayout())
delete item;
remaining--;
removed = true;