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()
|
BWindow::~BWindow()
|
||||||
{
|
{
|
||||||
|
Lock();
|
||||||
|
|
||||||
fTopView->RemoveSelf();
|
fTopView->RemoveSelf();
|
||||||
delete fTopView;
|
delete fTopView;
|
||||||
|
|
||||||
@@ -435,6 +437,7 @@ BWindow::Quit()
|
|||||||
void
|
void
|
||||||
BWindow::AddChild(BView *child, BView *before)
|
BWindow::AddChild(BView *child, BView *before)
|
||||||
{
|
{
|
||||||
|
BAutolock locker(this);
|
||||||
fTopView->AddChild(child, before);
|
fTopView->AddChild(child, before);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -442,6 +445,7 @@ BWindow::AddChild(BView *child, BView *before)
|
|||||||
bool
|
bool
|
||||||
BWindow::RemoveChild(BView *child)
|
BWindow::RemoveChild(BView *child)
|
||||||
{
|
{
|
||||||
|
BAutolock locker(this);
|
||||||
return fTopView->RemoveChild(child);
|
return fTopView->RemoveChild(child);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -449,6 +453,7 @@ BWindow::RemoveChild(BView *child)
|
|||||||
int32
|
int32
|
||||||
BWindow::CountChildren() const
|
BWindow::CountChildren() const
|
||||||
{
|
{
|
||||||
|
BAutolock locker(this);
|
||||||
return fTopView->CountChildren();
|
return fTopView->CountChildren();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -456,6 +461,7 @@ BWindow::CountChildren() const
|
|||||||
BView *
|
BView *
|
||||||
BWindow::ChildAt(int32 index) const
|
BWindow::ChildAt(int32 index) const
|
||||||
{
|
{
|
||||||
|
BAutolock locker(this);
|
||||||
return fTopView->ChildAt(index);
|
return fTopView->ChildAt(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user