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:
parent
1f1df3671c
commit
ebea950b2d
@ -209,7 +209,8 @@ BLayout::RemoveView(BView* child)
|
||||
continue;
|
||||
|
||||
RemoveItem(i);
|
||||
delete item;
|
||||
if (item != child->GetLayout())
|
||||
delete item;
|
||||
|
||||
remaining--;
|
||||
removed = true;
|
||||
|
Loading…
Reference in New Issue
Block a user