From fed7414a59a3a5cfe353f7b1e66911bdf1e5e919 Mon Sep 17 00:00:00 2001 From: Rene Gollent Date: Sat, 7 Jun 2008 07:10:08 +0000 Subject: [PATCH] A view shouldn't be able to RemoveChild a view that it isn't in fact the parent of. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25835 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/interface/View.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/kits/interface/View.cpp b/src/kits/interface/View.cpp index 67cf19b368..841ec2b3b4 100644 --- a/src/kits/interface/View.cpp +++ b/src/kits/interface/View.cpp @@ -3488,6 +3488,9 @@ BView::RemoveChild(BView *child) if (!child) return false; + if (child->fParent != this) + return false; + return child->RemoveSelf(); }