* fDragBitmap was never initialized, leading to occasional crashes after the

first mouse click.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25155 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2008-04-25 11:39:47 +00:00
parent d092f4d8df
commit c4d143146c

View File

@ -239,6 +239,7 @@ EventDispatcher::EventDispatcher()
fNextLatestMouseMoved(NULL),
fLastButtons(0),
fLastUpdate(system_time()),
fDragBitmap(NULL),
fCursorLock("cursor loop lock"),
fHWInterface(NULL),
fDesktop(NULL)
@ -568,10 +569,9 @@ EventDispatcher::SetDragMessage(BMessage& message,
if (fDragBitmap != bitmap) {
if (fDragBitmap)
gBitmapManager->DeleteBitmap(fDragBitmap);
fDragBitmap = bitmap;
if (fDragBitmap)
if (fDragBitmap != NULL)
fDragBitmap->Acquire();
}
@ -705,8 +705,7 @@ EventDispatcher::_DeliverDragMessage()
fDraggingMessage = false;
fHWInterface->SetDragBitmap(NULL, B_ORIGIN);
if (fDragBitmap)
gBitmapManager->DeleteBitmap(fDragBitmap);
gBitmapManager->DeleteBitmap(fDragBitmap);
fDragBitmap = NULL;
}