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
This commit is contained in:
Stefano Ceccherini 2005-12-30 08:26:06 +00:00
parent 5615edfd4d
commit b34197fb51

View File

@ -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<BPoint>(const_cast<BPoint *>(&fParentOffset));
fOwner->fLink->Read<BRect>(const_cast<BRect *>(&fBounds));
fState->valid_flags |= B_VIEW_FRAME_BIT;
}
}
// update children as well