* Don't trust a message that we got goes to a handler that belongs to us.
* when we terminate gracefully and in the looper's thread, we no longer unlock ourselves. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15155 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -2248,6 +2248,10 @@ BWindow::task_looper()
|
||||
} else {
|
||||
gDefaultTokens.GetToken(messagePrivate.GetTarget(),
|
||||
B_HANDLER_TOKEN, (void **)&handler);
|
||||
|
||||
// if this handler doesn't belong to us, we drop the message
|
||||
if (handler != NULL && handler->Looper() != this)
|
||||
handler = NULL;
|
||||
}
|
||||
|
||||
if (handler == NULL || usePreferred)
|
||||
@@ -2280,6 +2284,11 @@ BWindow::task_looper()
|
||||
}
|
||||
}
|
||||
|
||||
if (fTerminating) {
|
||||
// we leave the looper locked when we quit
|
||||
return;
|
||||
}
|
||||
|
||||
Unlock();
|
||||
|
||||
// Are any messages on the port?
|
||||
|
||||
Reference in New Issue
Block a user