UpdateIfNeeded() no longer keeps the looper's BMessageQueue locked when
calling DispatchMessage(). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23870 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1698,27 +1698,25 @@ BWindow::UpdateIfNeeded()
|
|||||||
_DequeueAll();
|
_DequeueAll();
|
||||||
|
|
||||||
BMessageQueue *queue = MessageQueue();
|
BMessageQueue *queue = MessageQueue();
|
||||||
queue->Lock();
|
|
||||||
|
|
||||||
// First process and remove any _UPDATE_ message in the queue
|
// First process and remove any _UPDATE_ message in the queue
|
||||||
// With the current design, there can only be one at a time
|
// With the current design, there can only be one at a time
|
||||||
|
|
||||||
BMessage *msg;
|
while (true) {
|
||||||
for (int32 i = 0; (msg = queue->FindMessage(i)) != NULL; i++) {
|
queue->Lock();
|
||||||
if (msg->what == _UPDATE_) {
|
|
||||||
BWindow::DispatchMessage(msg, this);
|
BMessage *message = queue->FindMessage(_UPDATE_, 0);
|
||||||
// we need to make sure that no overridden method is called
|
queue->RemoveMessage(message);
|
||||||
// here; for BWindow::DispatchMessage() we now exactly what
|
|
||||||
// will happen
|
|
||||||
queue->RemoveMessage(msg);
|
|
||||||
delete msg;
|
|
||||||
break;
|
|
||||||
// NOTE: "i" would have to be decreased if there were
|
|
||||||
// multiple _UPDATE_ messages and we would not break!
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
queue->Unlock();
|
queue->Unlock();
|
||||||
|
|
||||||
|
if (message == NULL)
|
||||||
|
break;
|
||||||
|
|
||||||
|
BWindow::DispatchMessage(message, this);
|
||||||
|
delete message;
|
||||||
|
}
|
||||||
|
|
||||||
Unlock();
|
Unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user