Window has to be locked when it's going down or its children are queried/changed.
This fixed bug #182. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16454 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -312,6 +312,8 @@ BWindow::BWindow(BRect frame, int32 bitmapToken)
|
||||
|
||||
BWindow::~BWindow()
|
||||
{
|
||||
Lock();
|
||||
|
||||
fTopView->RemoveSelf();
|
||||
delete fTopView;
|
||||
|
||||
@@ -435,6 +437,7 @@ BWindow::Quit()
|
||||
void
|
||||
BWindow::AddChild(BView *child, BView *before)
|
||||
{
|
||||
BAutolock locker(this);
|
||||
fTopView->AddChild(child, before);
|
||||
}
|
||||
|
||||
@@ -442,6 +445,7 @@ BWindow::AddChild(BView *child, BView *before)
|
||||
bool
|
||||
BWindow::RemoveChild(BView *child)
|
||||
{
|
||||
BAutolock locker(this);
|
||||
return fTopView->RemoveChild(child);
|
||||
}
|
||||
|
||||
@@ -449,6 +453,7 @@ BWindow::RemoveChild(BView *child)
|
||||
int32
|
||||
BWindow::CountChildren() const
|
||||
{
|
||||
BAutolock locker(this);
|
||||
return fTopView->CountChildren();
|
||||
}
|
||||
|
||||
@@ -456,6 +461,7 @@ BWindow::CountChildren() const
|
||||
BView *
|
||||
BWindow::ChildAt(int32 index) const
|
||||
{
|
||||
BAutolock locker(this);
|
||||
return fTopView->ChildAt(index);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user