Skip to content

Commit

Permalink
BLayout: Don't delete the layout of the view in RemoveView().
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mmlr committed Apr 18, 2015
1 parent 1f1df36 commit ebea950
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/kits/interface/Layout.cpp
Expand Up @@ -209,7 +209,8 @@ BLayout::RemoveView(BView* child)
continue;

RemoveItem(i);
delete item;
if (item != child->GetLayout())
delete item;

remaining--;
removed = true;
Expand Down

0 comments on commit ebea950

Please sign in to comment.