[haiku-commits] haiku: hrev49048 - src/kits/interface

  • From: mmlr@xxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sat, 18 Apr 2015 13:37:56 +0200 (CEST)

hrev49048 adds 1 changeset to branch 'master'
old head: 1f1df3671c2c7bf65a8ce1ed5cd3414f25ae3e87
new head: ebea950b2df08711adaca9f2c0d282d48667e545
overview:
http://cgit.haiku-os.org/haiku/log/?qt=range&q=ebea950b2df0+%5E1f1df3671c2c

----------------------------------------------------------------------------

ebea950b2df0: 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.

[ Michael Lotz <mmlr@xxxxxxxx> ]

----------------------------------------------------------------------------

Revision: hrev49048
Commit: ebea950b2df08711adaca9f2c0d282d48667e545
URL: http://cgit.haiku-os.org/haiku/commit/?id=ebea950b2df0
Author: Michael Lotz <mmlr@xxxxxxxx>
Date: Sat Apr 18 11:18:29 2015 UTC

Ticket: https://dev.haiku-os.org/ticket/11976

----------------------------------------------------------------------------

1 file changed, 2 insertions(+), 1 deletion(-)
src/kits/interface/Layout.cpp | 3 ++-

----------------------------------------------------------------------------

diff --git a/src/kits/interface/Layout.cpp b/src/kits/interface/Layout.cpp
index a066f36..4feaa4c 100644
--- a/src/kits/interface/Layout.cpp
+++ b/src/kits/interface/Layout.cpp
@@ -209,7 +209,8 @@ BLayout::RemoveView(BView* child)
continue;

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

remaining--;
removed = true;


Other related posts:

  • » [haiku-commits] haiku: hrev49048 - src/kits/interface - mmlr