Reading the contents of the screen requires the exclusive lock

to avoid someone drawing into it at the same time. In a debug
build, this avoids hitting an ASSERT.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38478 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus 2010-08-31 11:45:53 +00:00
parent 45db9a2073
commit 5911196b9c

View File

@ -2963,16 +2963,21 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver& link)
BRect bounds;
link.Read<BRect>(&bounds);
bool success = false;
ServerBitmap* bitmap = GetBitmap(token);
if (bitmap != NULL) {
if (fDesktop->GetDrawingEngine()->ReadBitmap(bitmap,
drawCursor, bounds) == B_OK) {
fLink.StartMessage(B_OK);
} else
fLink.StartMessage(B_BAD_VALUE);
if (fDesktop->GetDrawingEngine()->LockExclusiveAccess()) {
success = fDesktop->GetDrawingEngine()->ReadBitmap(bitmap,
drawCursor, bounds) == B_OK;
fDesktop->GetDrawingEngine()->UnlockExclusiveAccess();
}
bitmap->ReleaseReference();
} else
}
if (success)
fLink.StartMessage(B_OK);
else
fLink.StartMessage(B_BAD_VALUE);
fLink.Flush();