From b34197fb51267f9286b697eba2e4f4a78a3ff6c3 Mon Sep 17 00:00:00 2001 From: Stefano Ceccherini Date: Fri, 30 Dec 2005 08:26:06 +0000 Subject: [PATCH] Fixed the possible race condition reported by stippi, by getting the bounds and parent offsets of the view on detach git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15736 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/interface/View.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/kits/interface/View.cpp b/src/kits/interface/View.cpp index 021406aee2..c0c3b0051d 100644 --- a/src/kits/interface/View.cpp +++ b/src/kits/interface/View.cpp @@ -4200,7 +4200,17 @@ BView::_UpdateStateForRemove() return; fState->UpdateFrom(*fOwner->fLink); - fBounds = Bounds(); + if (!fState->IsValid(B_VIEW_FRAME_BIT)) { + fOwner->fLink->StartMessage(AS_LAYER_GET_COORD); + + status_t code; + if (fOwner->fLink->FlushWithReply(code) == B_OK + && code == B_OK) { + fOwner->fLink->Read(const_cast(&fParentOffset)); + fOwner->fLink->Read(const_cast(&fBounds)); + fState->valid_flags |= B_VIEW_FRAME_BIT; + } + } // update children as well