* it should be better to lock before accessing the data, even if reading only
* after this change, I have not spotted "left behind" cursors again, but it might just be bad luck... git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21966 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
86d8381f5f
commit
91d0586a7d
@ -382,18 +382,20 @@ HWInterface::HideOverlay(Overlay* overlay)
|
||||
bool
|
||||
HWInterface::HideSoftwareCursor(const BRect& area)
|
||||
{
|
||||
if (!fSoftwareCursorLock.Lock())
|
||||
return false;
|
||||
if (fCursorAreaBackup && !fCursorAreaBackup->cursor_hidden) {
|
||||
BRect backupArea(fCursorAreaBackup->left,
|
||||
fCursorAreaBackup->top,
|
||||
fCursorAreaBackup->right,
|
||||
fCursorAreaBackup->bottom);
|
||||
if (area.Intersects(backupArea)) {
|
||||
fSoftwareCursorLock.Lock();
|
||||
_RestoreCursorArea();
|
||||
// do not unlock the cursor lock
|
||||
return true;
|
||||
}
|
||||
}
|
||||
fSoftwareCursorLock.Unlock();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user