* 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:
Axel Dörfler
2005-11-25 21:06:37 +00:00
parent 84081467b9
commit 7c6865642c
2 changed files with 18 additions and 0 deletions
+9
View File
@@ -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?