Check if we have a window before drawing the item in

BListView::_Deselect()


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21107 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stefano Ceccherini
2007-05-10 20:40:48 +00:00
parent c0d5509623
commit 522528180e
+4 -3
View File
@@ -1323,8 +1323,9 @@ BListView::_Deselect(int32 index)
if (index < 0 || index >= CountItems())
return false;
BAutolock locker(Window());
if (Window() && !locker.IsLocked())
BWindow *window = Window();
BAutolock locker(window);
if (window && !locker.IsLocked())
return false;
BListItem *item = ItemAt(index);
@@ -1346,7 +1347,7 @@ BListView::_Deselect(int32 index)
fLastSelected = _CalcLastSelected(index);
}
if (bounds.Intersects(frame))
if (window && bounds.Intersects(frame))
DrawItem(ItemAt(index), frame, true);
}